We don't bite newbies here... much | |
PerlMonks |
Re: perl: How to comapre and manipulate csv file in perl?by misterperl (Pilgrim) |
on Oct 01, 2014 at 14:53 UTC ( [id://1102545]=note: print w/replies, xml ) | Need Help?? |
I have many comments on your code , but Im not really sure what you're trying to accomplish so I'l keep it short.
It seems like you're trying to operate on 2-row blocks? Like if the first row meets some match criteria, then meld it into the next row? ...then maybe break up the file into 2-row blocks and use regexes on each one.. Like split it this way:
then you can just use something like
then repeat that starting on the first even row (because the regex always checks the FIRST row for matches). Much simpler than storing all those temporary arrays, whiles, ifs, etc. But here are few recomendations:
In Section
Seekers of Perl Wisdom
|
|