http://www.perlmonks.org?node_id=1015249


in reply to Re: Copy rows of file to new document
in thread Copy rows of file to new document

I tried but I can't seem to get it to work. I'm really new to this all. If I can't figure it out then I'll have to start doing them manually.

My data is located in the directory 'c:\incoming\temp'. I don't know if I should make a file or will the script make it for me? Any help will be appreciated, even if you have to write it out exactly for me. I know you guys have tried to make it as clear as possible but I'm really having such a difficult time. I have so much work today and the boss won't be paying me if I have to catch up on the weekend. I'm as desperate as one can be to get this thing to work. Once again, all the help is appreciated.

#!/usr/bin/perl use strict; use warnings; my $dir_path="\Incoming\Temp"; opendir (Incoming\Temp, $tmp_dir) or die $!; open (MYFILE, '>>vehicles.txt'); while (my $file_name = readdir(Incoming\Temp)) {print "$file_name\n";} print MYFILE $file_content; close (MYFILE); CLOSEDIR;