Walt Mankowski on 22 Dec 2010 10:01:17 -0800


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

Re: [PLUG] Script Help?


On Wed, Dec 22, 2010 at 12:39:44PM -0500, 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\Manoji Roberts\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\Manoji Roberts\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..

These seem to work:

sed:

sed 's/\([^\]*\)$/\1\t\1/'

perl:

perl -pe 's/([^\\]*)\n/$1\t$1\n/'

Attachment: signature.asc
Description: Digital 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