Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This will work under the assumption that all input files have the same number of lines.
However, if you have for example
Sample of text-1.txt files: Sample of text-2.txt files: Sample of text-3.txt files: the array would have the content 'Line_9_9' and 'Line_10_10' in the second column (where one would expect content from the second file only). This is because push simply appends at the end of the array. To avoid that it would be better to use fixed indexing instead of push: So could be replaced by this
This would put the timestamps always in the right places, but you would have to be prepared to have 'holes' in the array, if the input files have different number of lines. You can test if an array cell has a value assigned with code like the following: Hope this helps! Update: forgot a closing brace in the new code block. It is now fixed. In reply to Re^2: Concatenating arrays fetched from different text files
by hexcoder
|
|