garyboyd has asked for the wisdom of the Perl Monks concerning the following question:
Hi, could someone give me pointers/pseudocode for converting a tab-delimited file into a different format?
My data looks like this:
Name_1 TT XL_927799.1 Name_1 PA PA_392 Name_1 AT ZX_003039195.1 Name_2 TT XL_931313.1 Name_2 AT ZX_003043016.1 Name_3 TT XL_929616.1 Name_3 PA PA_5040 Name_3 PA PA_6336 Name_4 TT XL_928294.1 Name_4 PA PA_917
And I want to get it into this format:
PA TT AT PA_392 XL_927799.1 ZX_003039195.1 XL_931313.1 ZX_003043016.1 PA_5040,PA_6336 XL_929616.1 PA_917 XL_928294.1
The information in each row is separated by tabs and any field containing more than one eg Name_3 has two PA entries, will produce both entries separated by a comma.
If there is no entry a blank should be left or I suppose "No corresponding entry"
Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: reformatting tab delimited file
by davido (Cardinal) on Sep 05, 2011 at 15:00 UTC | |
Re: reformatting tab delimited file
by Cristoforo (Curate) on Sep 05, 2011 at 23:24 UTC | |
by garyboyd (Acolyte) on Sep 06, 2011 at 09:03 UTC | |
Re: reformatting tab delimited file
by Anonymous Monk on Sep 05, 2011 at 15:00 UTC |
Back to
Seekers of Perl Wisdom