Purchase Solution

Perl scripts for file processing

Not what you're looking for?

Ask Custom Question

Write separate Perl scripts for each of the given requirements. Mentioned input data files are attached with this posting. In each case command to run the script from the command line should look like:

COMMAND_PROMPT> script_number.pl input_data_file.txt

[1] A script script_1.pl that replaces each instance of "th" with "TH" in file part1.txt. The script should print the file to the screen, not just the replaced lines.

[2] A script script_2.pl to look for lines in the file part2.txt containing a period, question mark, or comma at the end of the line. When these lines are found, print only the part of the line that occurs after the word "it" (case insensitive).

[3] A script script_3.pl that prints only words (not the entire line) in the file part3.txt on a word boundary that have the letter "p" or "P" in them (i.e. words begin/end with P/p).

Purchase this Solution

Solution Summary

Please ensure that part2.txt is saved with Unix style newline ending, else the corresponding script will not give the expected output.

Solution Preview

You can implement the script in many ways. One such implementation of these three scripts is attached as 238400.zip. You can use ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Networking Questions

This quiz consists of some basic networking questions.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

C# variables and classes

This quiz contains questions about C# classes and variables.