
Jojoma
New User
Mar 7, 2007, 5:04 PM
Post #1 of 2
(1280 views)
|
|
Reads a file and uses regular expressions to modify file.
|
Can't Post
|
|
Hi guys, I need a perl script that does the following. 1. Reads the attached file dog.txt as either a here document or as input via a file handel on STDIN 2. Incorporates regular expressions to A. Stop out all excess spaces, leaving a single space between each word. B. Search for the pattern (space) I (space) Thats a capital I and a space on each side. Count all instances of this pattern, return thetotal number of instances, and print this output to a file called patterns.txt. supported by text similar to "The pattern _I_ was found x times." C. Output all text enclosed in quotes into a separate (second) file called quotes.txt D. Print the output to a separate (third) text file named out.txt Thanks for any help. :)
|