|Just another Perl shrine|
arrays of arraysby monkantar (Initiate)
|on Sep 07, 2007 at 13:12 UTC||Need Help??|
monkantar has asked for the wisdom of the Perl Monks concerning the following question:
I am a starter in PERL and new to this website. For linguistic research, I should convert textcorpora with data such as:
I thought writing a script for this function would be a piece of cake, but that wasn't the case...
I wrote a simple toy program with words and numbers to start :
the output is:
input.txt consists of following textline:
book 1 pencil 2 desk 3
This program works only for one line of text. For the moment I am reading about arrays of arrays as I want the program to work for each line in a text and push the selected items at the end of each line but I don't know if this approach will work. Does someone knows... or has written similar programs and can give me some advice for writing such a PERL script?
Thanks a lot!