Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

CColin's scratchpad

by CColin (Scribe)
on Feb 24, 2011 at 20:30 UTC ( #890049=scratchpad: print w/replies, xml ) Need Help??

#!/usr/bin/perl use warnings; use strict; my $linecount = 0; my @files = </path_to_nine_files_prefixed_by_rawfile/rawfile*>; open (MASTER, "/path_to_starting_file/rawfile"); while (<MASTER>) { #process the first line of master and then get the first #line of the +other files, since files are all same length... $_ =~ s/^\s+|\s+$//g; print "$_,"; #process the first lines of each of the other files and #append them foreach my $file (@files) { open (FILE, $file); my @file_lines = <FILE>; my $required_line = $file_lines[$linecount]; print "$required_line,"; next; } #end foreach $file print "\n"; $linecount++; } #end while
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[1nickt]: Life is weird. Just reading about the iPhone battery problems and saw: 'It’s like calling water “dihydrogen monoxide”'

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2016-12-06 14:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (105 votes). Check out past polls.