P is for Practical | |
PerlMonks |
How can one sort array elements in different text files?by supriyoch_2008 (Monk) |
on Nov 05, 2019 at 16:52 UTC ( [id://11108334]=perlquestion: print w/replies, xml ) | Need Help?? |
supriyoch_2008 has asked for the wisdom of the Perl Monks concerning the following question: Hi Perlmonks, I am interested to sort the elements of an array by two's or three's in different text files within a folder. The array is @array=qw/a b c d e f g h i/; within the "result" folder the text file 1.txt should contain a b; 2.txt should contain c d; 3.txt should contain e f etc. I have written a code but it does not give the desired results. I welcome suggestions from perlmonks to solve this problem. Here goes my code:
I got the results as follows with the creation of a Result folder containing 9 text files i.e. 1.txt ... 9.txt:
The expected Result folder must contain 5 text files with two elements like:
Back to
Seekers of Perl Wisdom
|
|