Say i have 2 files in the giving format:
file1
1 2 3 4
1 2 3 4
1 2 3 4
file2
1 2 3 4
1 2 3 4
1 2 3 4
I have a PERL code (loaned by one of u -i forgot who - thanks!) that extracts the 2nd column from each file and append horizontally to a new file:
perl -ane 'push @{$L->[$.]}, $F[1]; close ARGV if eof;
END { shift @{$L}; for $l (@{$L}) { print join (" ", @{$l}), "\n"; }}' * >> out.txt
Which does the job for over 900 files --but I think it's doing it randomly. The files have an alphanumerical name that follows a chronoloigcal order --and that's the order I would like them to be appended in.
How edit the script so that the job is executed as such.
desire final result: (disregard the spacing)
file1 file2
2 2
2 2
2 2
thanks in advance --!!!!