Eric at Lucii.org on 22 Dec 2010 10:02:48 -0800 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] Script Help? |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel: Assuming your input file is named forty_k_lines.txt you can use gawk like this: gawk --field-separator \\ '{printf("%s\t%s\n",$0,$NF)}' forty_k_lines.txt That separates the file name from the preceding full file name with a tab. If you need spaces use this instead: gawk --field-separator \\ '{printf("%s %s\n",$0,$NF)}' forty_k_lines.txt Hope that helps. Eric On 12/22/2010 12:39 PM, Daniel.Roberts@sanofi-aventis.com wrote: > Hello All > > What might be a Linux command line way of reading a large file of about 40,000 > lines of like below > A K:\DAN\Integrated Genomics\ManojiRoberts\Platform > Technology\Affymetrix Expression\27APR2007\Rabbit430_2\4-27-2007_DGMR-CT55_Part3.DTT > > And preparing a file that looks like > > A K:\DAN\Integrated Genomics\ManojiRoberts\Platform > Technology\Affymetrix > Expression\27APR2007\Rabbit430_2\4-27-2007_DGMR-CT55_Part3.DTT > 4-27-2007_DGMR-CT55_Part3.DTT > > > That is the filename is always after the last "\" of any given line and I would > like that complete filename copied into a new column…seperated by a tab.. > Thanks for any help! > Dan > > > > ___________________________________________________________________________ > 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 - -- # Eric Lucas # # "Oh, I have slipped the surly bond of earth # And danced the skies on laughter-silvered wings... # -- John Gillespie Magee Jr -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0SPTsACgkQ2sGpvXQrZ/7kugCgjy/dApqAsOzoqJg7n5ZA8zuH YZQAniLYboiMTxVaWbrH54aK/pn39jB8 =MJi/ -----END PGP SIGNATURE----- ___________________________________________________________________________ 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