Please ask any questions you may have:
PERL SCRIPT FOR WINDOWS 10: Strawberry Perl (64-bit) 5.24.0.1-64bit
Input Data: Consists of up to100,000 individual text files, in a single directory, named [login to view URL] to [login to view URL]
Step 1: Rename the files, left-padding, to 6 spaces:
Files [login to view URL] to [login to view URL] become [login to view URL] to [login to view URL]
Files [login to view URL] to [login to view URL] become [login to view URL] to [login to view URL]
Files [login to view URL] to [login to view URL] become [login to view URL] to [login to view URL]
Files [login to view URL] to [login to view URL] become [login to view URL] to [login to view URL]
Files [login to view URL] to [login to view URL] become [login to view URL] to [login to view URL]
File [login to view URL] remains [login to view URL]
Step 2: Create a single (up to 100,000-line) text file, one line for each of the up to 100,000 individual text files from the single directory, which were originally named [login to view URL] to 100000.txt.
Format is:
A B C D E F 1 [login to view URL] G
A B C D E F 2 [login to view URL] G
. . .
A B C D E F 10 [login to view URL] G
. . .
A B C D E F 100 [login to view URL] G
. . .
A B C D E F 1000 [login to view URL] G
. . .
A B C D E F 10000 [login to view URL] G
. . .
A B C D E F 100000 [login to view URL] G
Dear Sir !
I created script for you .
I hope we can work together.
regards
g
[login to view URL]:
use strict;
use warnings;
my $counter = 0;
my $file_name ="";
my $new_name ="";
my $log_file ="[login to view URL]";
open(my $fh0, '>', $log_file) or die "Could not open file '$log_file' $!";
for ($counter = 1 ; $counter <= 100000; $counter ++)
{
$file_name = "$[login to view URL]" ;
if ( -e $file_name )
{
print "Processing $file_name :" ;
$new_name = sprintf ("%06d",$counter) . ".txt";
print "rename to $new_name ";
rename $file_name , $new_name;
print "write to log file ..\n";
print $fh0 "A B C D E F $counter $new_name G\n";
}
else
{
print "$file_name not exist.\n" ;
}
}
close $fh0;
exit;
$30 USD in 1 day
5.0 (1 review)
1.7
1.7
6 freelancers are bidding on average $34 USD for this job
This is pretty easy work for me. I can complete it in next 4 hours.
All I need to start is milestone payment from you. You'll release it only after you check everything on your side.
Thanks.
Roman
Hello,
I am the premier Perl scripting expert on these freelancing sites. I will create a Perl script to rename these files and build the text file according to your specifications.
A milestone payment for the full budget for this project must be deposited with this site before your offer can be accepted.
Alan Idler
Chief Software Architect
Idleswell Software Creations
Hi Canadiancarrie,
I am competitive to this kind of task, can take good care of this project. In fact, I already done related to this job before. Let me know the best of your time so we can discuss further based on your requirements and we can move forward to the next step.
Thanks,
Joseph C Ocero