Page 1 of 1

Newbie Question

Posted: Tue Jan 20, 2004 9:32 pm
by proto
Hi, heres a short sample of what I have.

"BANCO0000001","BANCO0000001","ITC 05002","ITC 05002","1","004\00000001.tif"


I have 700 lines of this and i need to delete the last comma seperated field.

ie ,"004\00000001.tif"
needs to be deleted from each line.

the next line is "004\000000002.tif" and so on. Occasionaly the tiff numbers will skip ie after 000000009.tiff might be 000000022.tiff etc...

any ideas? I've tried to bring it into excel, which is easy to delete the column, but then when I save it as a text file, it deletes all the " marks :(

dont know whether i should figure out how to do this in excel or text pad...any advice is appreciated

thanks
proto

Posted: Tue Jan 20, 2004 9:55 pm
by s_reynisson
This keeps the last comma.
find ^(("[^"]*",){5}).*$
replace \1

And this does not.
find ^("[^"]*"(,"[^"]*"){4}).*$
replace \1

I have used POSIX regular expression syntax, which can be selected
from the Editor page of the Preferences dialog box. HTH

Posted: Wed Jan 21, 2004 10:38 am
by MudGuard
A slightly simpler solution which assumes there are no commas within the "":

search for
,[^,]*$
replace by nothing or by comma, depending on your needs to remove or keep the comma.