Perl Script to do Text File Edits
Expert Perl Scripting (Strawberry Perl version 5.20) I am using Perl 5.20.1 (64 bit) on Windows 7 but it shouldn't be a problem if you do the development on Unix, as long as it's compatible with Strawberry Perl.
This is perl 5, version 20, subversion 1 (v5.20.1) built for MSWin32-x64-multi-t
hread. Copyright 1987-2014, Larry Wall
Ability to read/write/manipulate input and output files in Text format.
This is a pretty simple project to develop a Perl script to do text processing and to generate output files that are similar to the input files, with pre-defined edits made automatically by the Perl script.
Six sample files are attached, with descriptions as follows:
File1-before-Script.txt is the input file into your script (sample input file #1).
File2-before-Script.txt is the input file into your script (sample input file #2).
File3-before-Script.txt is the input file into your script (sample input file #3).
File1-after-Script.txt is the output file into your script (sample output file #1).
File2-after-Script.txt is the output file into your script (sample output file #2).
File3-after-Script.txt is the output file into your script (sample output file #3).
Note: I made these edits manually with a text editor to show what the script should do.
Assumptions: Intput files and output files are Text Files. The output file should have the same number of lines as the input file.
Your Perl Script needs to be able to transform (automatically edit) the files, according to the following rules:
1. One variable is suggested for your script, which is the additional chaacters added to the end of the filename for the output file. The script default should be "-weak"
Example 1: If the input filename is file1.txt then the output filename should be file1-weak.txt.
Example 2: If the input filename is filename2.txt the output filename should be filename2-weak.txt
2. The default behavior of the script should be to write the exact line that is in the input file to the output file.
3. For lines begining with the three characters [+], your script will automatically change these lines:
a. All characters before the first occurrence of the word "SSL" will be deleted.
b. All characters before the first occurrence of the word "TLS" will be deleted.
Note: You can assume that a given line will have not have both words, "SSL and "TLS".
c. All characters after the first occurence of the right parenthesis ")" will be deleted.
d. The output file(s) should be written to the same directory using the file name modification specified by the variable (see #1 above)
This project must be completed with native Perl commands. I do not have a C compiler and do not want to install additional PERL modules unless necessary to do so.
- A work style that is extremely detail oriented
- Advanced Perl Scripting Abilities
- Access to a Test box to do your development on.
- Strong communication skills
- A complete Elance profile
- Completed Perl Script that will be uploaded to the workroom.
- Documentation on your script (syntax,parameters, command line options, limitations etc.)