jtucker has asked for the wisdom of the Perl Monks concerning the following question:
Monks:
I am bit stuck on this one.
I have a data set such as this:
1:1 word1
1:1 word2
1:1 word3
1:1 word4
1:2 word1
1:2 word2
1:2 word3
1:3 word1
1:3 word2
1:3 word3
I have stored each line into an array. I need to distinguish where the increment occurs and insert a header, thus transforming my data to:
>1:1
1:1 word1
1:1 word2
1:1 word3
1:1 word4
>1:2
1:2 word1
1:2 word2
1:2 word3
>1:3
1:3 word1
1:3 word2
1:3 word3
Any insights would be greatly appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Editing Listed Data
by igelkott (Priest) on Mar 25, 2013 at 00:38 UTC | |
by jtucker (Initiate) on Mar 25, 2013 at 00:47 UTC | |
by Anonymous Monk on Mar 25, 2013 at 01:03 UTC | |
by Anonymous Monk on Mar 25, 2013 at 01:06 UTC | |
by jtucker (Initiate) on Mar 25, 2013 at 03:56 UTC | |
Re: Editing Listed Data
by kcott (Archbishop) on Mar 25, 2013 at 04:34 UTC | |
by jtucker (Initiate) on Mar 25, 2013 at 16:40 UTC |