* Abner Gershon (abner_gershon@yahoo.com) [020220 09:01]: > Can someone tell me search and replace commands I can > use to convert comma delimited text in form: > "field 1","field 2","field 3" > to text file to be used in tabular latex file of form: > field 1 & field 2 & field 3 :%s/","/ \& /g :%s/"//g > I did this once before but it took me a few hours to > figure out and I don't recall how I eventually did it. Then I should probably help you understand it to make sure you don't spend any more hours on similar problems. There are many different ways you could tackle this problem. The way I give above does it in 2 steps: change /","/ to / & /, and then remove the first and last quotation marks (the ones that aren't part of a /","/ sequence). Be careful with the second line if you have quotation marks embedded in your fields, though, even if they're escaped with a backslash or something. If that's the case, you might want to do something like this first: :%s/\\"/<EMBEDDEDQUOTE>/g and this afterward: :%s/<EMBEDDEDQUOTE>/"/g There are probably more elegant ways, and I'm sure someone else on the list will bring them, but these should work for you. good times, Vineet -- Currently seeking opportunities in the SF Bay Area Please see http://www.doorstop.net/resume/ -- Satan laughs when we kill each other. Peace is the only way.
Attachment:
pgpr8QF0immHA.pgp
Description: PGP signature