Hi,
: I know this is done with regular expressions, but I don't know how. I have text file that contains many lines of information. How would I find the line that contains the word "subject:". Then once that line is found how would i get only the text after the colon in to a variable? For example, let say the line is in row 56 and it looks like this: "subject: ORDER CONFIRMATION". How would I find the subject, and how do I get the "ORDER CONFIRMATION". I need to find the subject and only get the subject.
OK, I'm still trying to get better at reg exp myself, but I think I may have the answer to this one.
open FILE, "<textfile.txt";
while (<FILE>) {
if (/subject\: (.*)/) {
$whatyouwant = $1;
}
}
close FILE;
Let me know if that works, I gotta run deal with something so can't test it right now.
Hope this helps,
Jonathan
-------------------------------------------
Count your downloads:
http://www.downloadcounter.com/
And host your site:
http://www.incrahost.com/
Don't say I never give you anything...