Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Perl script help to convert .txt file to .csv

by BrowserUk (Patriarch)
on Dec 20, 2011 at 14:13 UTC ( [id://944400]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    c:\test>perl -l -0x3e -ane"@F||next; s/length=//for$F[1]; @F[5]=join''
    +,@F[5..99]; $#F=5; print'>',join',',@F" junk.dat
    >G9JVYGV01AJE8V,135,xy=0104_0349,region=1,run=R_2011_09_20_15_00_06_,G
    +GTGGTAGTGAAGAAGAGGAGATGAAAGTGGAAGAGGTTGAGGATGAGAAGGTTGAATTGGAAGAAGAAG
    +ATGAGAAGGTTGAAGTGGAAGATGAGAAGGTTGAAGTGGAAGAAGATGAAGTGGAAGAGAGGAGC
    ...
    >G9JVYGV01BVCPK,46,xy=0650_0134,region=1,run=R_2011_09_20_15_00_06_,GC
    +AAGATCGCAAGCCAAGCAACGTTTCACGAACTGGCCAGAATGAG
    >G9JVYGV01AOU3I,81,xy=0166_0220,region=1,run=R_2011_09_20_15_00_06_,TC
    +ATTGACATCTGTGCAGCTGCAGGAGCGGATATGAGGAGATGGTTCTATCTGCACAGATGTCAATGAGTG
    +TGACAGTGAT
    >G9JVYGV01A0JEL,61,xy=0299_0171,region=1,run=R_2011_09_20_15_00_06_,CG
    +AGTGAAGGCATTGGTGATGCTGGTGTGAAGAGTGAGGGCATCGCCAATGCCTTCACTCG
    
  2. or download this
    
    c:\test>perl -MO=Deparse -l -0x3e -ane"@F||next; s/length=//for$F[1]; 
    +@F[5]=join'',@F[5..99]; $#F=5; print'>',join',',@F" junk.dat
    ...
    }
    -e syntax OK
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://944400]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2024-04-25 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found