in reply to Re: opening many files
in thread opening many files

thank you for reply. it is working file except i want 948 rows and 200 columns from 200 files. the program is giving me 200 rows and 948 columns. thank you.

Replies are listed 'Best First'.
Re^3: opening many files
by jwkrahn (Abbot) on Feb 27, 2012 at 23:48 UTC
    @ARGV = glob 'datafile*'; open my $OUTPUT, '>', 'output_file' or die "Cannot open 'output_file' +because: $!"; my %data; while ( <> ) { next unless /^(.+) (\S+)$/; push @{ $data{ $1 } }, $2; } for my $key ( sort keys %data ) { print join ' ', $key, @{ $data{ $key } }, scalar @{ $data{ $key } +}, "columns\n"; }
      thank you. the code is working fine. could you please help me understand the code. i am a beginner in perl and had hard time understanding the hi-fi code. also could you please explain how sort is working in your code. what changes do i have to make to code to get all the data with out any sorting. thank you.

        understanding the hi-fi code

        What code are you calling the hi-fi code?

      thank you. the code is working fine. could you please explain how sort is working in your code. what changes do i have to make to code to get all the data with out any sorting. thank you