Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Need help in file processingby utpalmtbi (Acolyte) |
on Feb 01, 2013 at 07:48 UTC ( [id://1016472]=perlquestion: print w/replies, xml ) | Need Help?? |
utpalmtbi has asked for the wisdom of the Perl Monks concerning the following question: Hello all, I just started learning Perl and I get stuck on a basic file processing : I have to convert a file format, the program should read a input file and after processing (which counts the number of each term in each group, see below), yield a output file. Here is the format of the input file: Group1: somo|112345478 somo|734567233 homo|233689876 Group2: somo|904686712 somo|891145662 somo|106736432 Group3: aomo|397634567 aomo|123446789 Group4: aomo|905672345 aomo|120846789 ........ .. From the above input, the output file should look like (the numbers after the pipe should not be considered):
somo homo aomo Group1 2 1 0 Group2 3 0 0 Group3 0 0 2 Group4 0 0 2 I get stuck on this file conversion for sometime now and unable to figure it out. Any guidance is highly appreciated. Thanks in advance.. Apologies if this post doesn't belong here...
Back to
Seekers of Perl Wisdom
|
|