I have a relatively large csv/text data file (33mb) that I need to do a global search and replace the delimiting character on. (The reason is that there doesn't seem to be a way to get SQLServer to escape/handle double quotes in the data during a table export, but that's another story...)
I successfully accomplished a Textmate search and replace on a smaller file, but it's choking on this larger file.
It seems like command line grep may be the answer, but I can't quite grasp the syntax, ala:
grep -rl OLDSTRING . | xargs perl -pi~ -e ‘s/OLDSTRING/NEWSTRING/’
So in my case I'm searching for the '^' (caret) character and replacing with '"' (double-quote).
grep -rl " grep_test.txt | xargs perl -pi~ -e 's/"/^'
That doesn't work and I'm assuming it has to do with the escaping of the doublequote or something, but I'm pretty lost. Help anyone?
(I suppose if anyone knows how to get SQLServer2005 to handle double quotes in a text column during export to csv, that'd really solve the core issue.)