Hi Monks!
I need your advice once again. I have a .txt file that has over 200,000 rows in it. It is therefore too big to modify by hand. I am trying to write a script that I can apply to it that will do the following:
Take the original format (short example shown here):
0 ASDF
ASEE
ASEE
13 DERG
DREG
28 QWER
QWER
42 WERT
WERT
WERT
55 QWEASD
QWEASD
QWEASD
QWEASD
And change the format of this file into this:
0 0
0
0
13 13
13
28 28
28
42 42
42
42
55 55
55
55
55
Can anyone give me a suggestion of how to do this in perl? Your help is greatly appreciated. Thanks in advance.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|