Help needed on a Pearl programming Lab
Help needed on a Pearl programming Lab
Lab 6
Attached Files:
alice(1).txt (142.212 KB)
SampleConf(1).txt (3.561 KB)
lab6_incompleteSolution.pl (1.353 KB)
lab6_helpFile1.txt (669 B)
hello.pl (53 B)
openfile.pl (1.138 KB)
typing.pl (361 B)
Create a Perl program that is simply a loop over a set of “Regular Expressions” that perform the tasks described below. Use the attached file SampleConfig.txt as input.
Note1: The Alice.txt file will only be used as part of an “In Lab” example/tutorial.
Note2: Though this is a bit assignment is a bit contrived, it does represent the types of actual text manipulations that might be performed over many large files.
Instructions:
Using the attached SampleConfig.txt file, provide a Perl regular expression for each of the following tasks:
- Remove any leading or trailing space from each line.
- Replace all of the occurrences of a full line of # characters (ignoring leading or training spaces and lines with just 1 #) with the following: # ———- #
- Change any URL ending in .htm to end with .html
- For any set of multiple words following an equal sign (=), place what follows the equal sign in quotes.
- eg: a = bcd efg becomes a = “bcd efg”
- eg: a = bcd remains a = bcd
- Add a semicolon (;) to the end of every line.
- Every line beginning with a comment marker (#) and containing additional text should have one (and only one) space following the comment marker.
- For example:
# some text becomes….
# some text
- For example:
- Replace any pattern in the form of [__UPPER-CASE CHARACTERS__] with (lower-case characters)
- ie: Open square bracket + two underscores + upper-case text + two underscores + close square bracket
- eg:[__SOMEDATA__] becomes [somedata]
- Follow every “config section” with a comment that indicates the current section count:
- For example:
[SVN] # Section: 1
[……] # Section: 2
etc.
- For example:
Submit:
- A file containing the Perl code to fulfill the above requirements
- A version of the SampleConfig.txt file incorporating all of the above changes.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


