bergman on 31 Aug 2010 11:11:13 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Sed or awk help?!


The pithy ruminations from <Daniel.Roberts@sanofi-aventis.com> on "Re: [PLUG] Sed or awk help?!" were:

=> Actually..
=> Here is a small snippet of the huge file that I am trying to process
=> 
=> Note that the filename is always in the fifth column of a tab delimited

OK.


=> file...and the filename itself could contain periods....but it will
=> always end in the ".CEL" filename extension which is what I am looking
=> to remove...

Is it possible that other fields may have the character string ".CEL", followed by a tab?

If not:

	sed -e "s/\.CEL\t/\t/" inputfile > outputfile	[for a reasonably modern "sed" that understand the "\t" notation for TAB]

If there may be other fields that end in ".CEL", then it's more difficult. I'd have to brush off my awk, or use perl. 

If I understand the specs correctly, try this:

	awk '{sub("\\.CEL$","",$5);  print}' inputfile > outputfile


Mark "I'll send you a consulting bill...you can fax cash or email a check. :)" Bergman

=> The filename has many different conventions, it may contain any
=> combination of numbers and letters, but always ends in a .CEL file name
=> extension...
=> So If I could re-write the same file w/o the .CEL extensions that would
=> be great!
=> Dan
=> 
=> 
=> 
=> 10	3EDD188D-91D3-4104-8992-E12D4B5F4785	3242
=> AFFY_LIMS_DATA_OLD	012799Kas19KA85305_26.CEL
=> \\DGMappafs01\archivedata\1999
=> 11	3EDD188D-91D3-4104-8992-E12D4B5F4785	3243
=> AFFY_LIMS_DATA_OLD	012799Kas19KA85305_33.CEL
=> \\DGMappafs01\archivedata\1999
=> 12	3EDD188D-91D3-4104-8992-E12D4B5F4785	3244
=> AFFY_LIMS_DATA_OLD	020599Kas19KA04.CEL
=> \\DGMappafs01\archivedata\1999
=> 13	3EDD188D-91D3-4104-8992-E12D4B5F4785	3245
=> AFFY_LIMS_DATA_OLD	020599Kas19KA06.CEL
=> \\DGMappafs01\archivedata\1999
=> 14	3EDD188D-91D3-4104-8992-E12D4B5F4785	3246
=> AFFY_LIMS_DATA_OLD	020599Kas19KA01.CEL
=> \\DGMappafs01\archivedata\1999
=> 15	3EDD188D-91D3-4104-8992-E12D4B5F4785	3247
=> AFFY_LIMS_DATA_OLD	012799Kas19KA85305_29.CEL
=> \\DGMappafs01\archivedata\1999
=> 16	3EDD188D-91D3-4104-8992-E12D4B5F4785	3248
=> AFFY_LIMS_DATA_OLD	020599Kas19KA07.CEL
=> \\DGMappafs01\archivedata\1999
=> 17	3EDD188D-91D3-4104-8992-E12D4B5F4785	3249
=> AFFY_LIMS_DATA_OLD	020599Kas19KA08.CEL
=> \\DGMappafs01\archivedata\1999
=> 18	3EDD188D-91D3-4104-8992-E12D4B5F4785	3250
=> AFFY_LIMS_DATA_OLD	020599Kas19KA03.CEL
=> \\DGMappafs01\archivedata\1999
=> 19	3EDD188D-91D3-4104-8992-E12D4B5F4785	3251
=> AFFY_LIMS_DATA_OLD	020899Kas19KA02.CEL
=> \\DGMappafs01\archivedata\1999
=> 20	3EDD188D-91D3-4104-8992-E12D4B5F4785	3252
=> AFFY_LIMS_DATA_OLD	020999Kas19KC06.CEL
=> \\DGMappafs01\archivedata\1999
=> 21	3EDD188D-91D3-4104-8992-E12D4B5F4785	3253
=> AFFY_LIMS_DATA_OLD	020999Kas19KC03.CEL
=> \\DGMappafs01\archivedata\1999
=> 22	3EDD188D-91D3-4104-8992-E12D4B5F4785	3254
=> AFFY_LIMS_DATA_OLD	020899Kas19KA04.CEL
=> \\DGMappafs01\archivedata\1999
=> 23	3EDD188D-91D3-4104-8992-E12D4B5F4785	3255
=> AFFY_LIMS_DATA_OLD	020899Kas19KA07.CEL
=> \\DGMappafs01\archivedata\1999
=> 24	3EDD188D-91D3-4104-8992-E12D4B5F4785	3256
=> AFFY_LIMS_DATA_OLD	020999Kas19KA07.CEL
=> \\DGMappafs01\archivedata\1999
=> 25
=> ___________________________________________________________________________
=> Philadelphia Linux Users Group         --        http://www.phillylinux.org
=> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
=> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
=> 



-----
Mark Bergman    Biker, Rock Climber, Unix mechanic, IATSE #1 Stagehand
'94 Yamaha GTS1000A^2
bergman@panix.com

http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=bergman%40panix.com

I want a newsgroup with a infinite S/N ratio! Now taking CFV on:
rec.motorcycles.stagehands.pet-bird-owners.pinballers.unix-supporters
15+ So Far--Want to join? Check out: http://www.panix.com/~bergman 
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug