Loading ...
Sorry, an error occurred while loading the content.
 

RE: [Perl-unix-users] How to append specified files into a big file

Expand Messages
  • Nguyen, David M
    Thanks, Jay. This makes sense but I need to write a script to prompt for user input, a start date and a begin date. For example, if user input start date is
    Message 1 of 1 , Jul 20, 2004
      Thanks, Jay. This makes sense but I need to write a script to prompt
      for user input, a start date and a begin date. For example, if user
      input start date is "0710" and end date is "0716" then I want the
      program to append all the files between that date range. Is there a
      way?



      For example:

      $myperl.pl



      Enter start date: 0710

      Enter end date: 0716



      Thanks again,
      David



      -----Original Message-----
      From: Jason Vincent [mailto:jayv@...]
      Sent: Tuesday, July 20, 2004 12:31 PM
      To: Nguyen, David M; 'perl-beginner@yahoogroups.com';
      'perl-unix-users@...'
      Subject: RE: [Perl-unix-users] How to append specified files into a big
      file







      @files = (

      'Meas.atl00.1040.0710,

      'Meas.atl00.1040.0711',

      'Meas.atl00.1040.0712',

      'Meas.atl00.1040.0713',

      'Meas.atl00.1040.0714',

      'Meas.atl00.1040.0715',

      'Meas.atl00.1040.0716');



      open (OUT, '>>bigfile.txt')||die $!;



      foreach (@files){

      open (IN, "$_")|| die $!;

      while (<IN>){

      print OUT $_;

      }

      close IN;

      }

      close OUT;





      Regards,

      Jay





      -----Original Message-----
      From: Nguyen, David M [mailto:david.m.nguyen@...]
      Sent: Tuesday, July 20, 2004 1:19 PM
      To: perl-beginner@yahoogroups.com;
      perl-unix-users@...
      Subject: [Perl-unix-users] How to append specified files into a big file

      I have all the files below under /mydir directory, I want to
      append ONLY the files highlighted into a big file names "bigfile.txt".
      How do I accomplish this?



      Meas.atl00.1040.0705

      Meas.atl00.1040.0706

      Meas.atl00.1040.0707

      Meas.atl00.1040.0708

      Meas.atl00.1040.0709

      Meas.atl00.1040.0710

      Meas.atl00.1040.0711

      Meas.atl00.1040.0712

      Meas.atl00.1040.0713

      Meas.atl00.1040.0714

      Meas.atl00.1040.0715

      Meas.atl00.1040.0716

      Meas.atl00.1040.0717

      Meas.atl00.1040.0718

      Meas.atl00.1040.0719

      Meas.atl00.1040.0720



      Thanks in advance,

      David





      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.