in reply to Remote Directory listing
OK - I have gotten along much farther now with your help.
I am able to get the list of files from the remote server, and create a local text file with the 10 most recent files.
I just need a little more help. I need to apply a regex (I think) as part of the process, as I need the date and time section each of the 10 file for the next step.
I have this as my last section, giving me the last 10 files in the list:
open(FILE, "<filelist.txt"); @file = <FILE>; chomp @file; close FILE; open (MYFILE, '>links.txt'); print MYFILE "$file[-1]\n"; print MYFILE "$file[-2]\n"; print MYFILE "$file[-3]\n"; print MYFILE "$file[-4]\n"; print MYFILE "$file[-5]\n"; print MYFILE "$file[-6]\n"; print MYFILE "$file[-7]\n"; print MYFILE "$file[-8]\n"; print MYFILE "$file[-9]\n"; print MYFILE "$file[-10]\n"; close (MYFILE);
Can I add something to that, that will use this regex "\d\d\d\d\d\d\d\d\_\d\d\d\d" and print just the portion of the filename that matches for each of the 10 files.
I hope that made sense.
Thanks again everyone for your help!
John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remote Directory listing
by aitap (Curate) on Jul 08, 2012 at 10:38 UTC |