Newbie Question

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
proto
Posts: 1
Joined: Tue Jan 20, 2004 9:15 pm

Newbie Question

Post 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
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post 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
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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.
Post Reply