New to PERL - i.e. five days! Hope the following is appropriate for this forum.
I have a simple task, but after a few hours of searching, cannot spot the answer, which I am sure is obvious.
I have PERL running on WinXP and I have text files like that shown at the bottom stored in MS Word.
I would like to read each line into a variable and then use regex to search for a string and extract the info. contained - it's a list of poker hands, so I want to know which hands I played, what was the result etc.
Question is what marks the line boundary - my little script seems to read about 20lines as one string, instead of each. In word, the end of each line seems to have a paragraph mark, but I can't search and replace for the ^p so, the only real paragraph mark is the one at the end of the document. NB. In word the following are displayed on consecutive lines, not with a double-line space as marked-up here.
What do I need to do to make PERL recognise the end of a line? In my little PERL book all the examples talk about manually inputted text, and not text read from a .txt file or something similar.
Thanks in advance for your help!
P.
------HAND 1------
Game #871100404: Texas Hold'em No Limit (15/30) - 2005/09/11 - 21:14:01 (UK)
Table "Tourney 1066310 - 21" Seat 9 is the button.
Seat 1: jaynos (1500 in chips)
Seat 2: Stev04055 (1480 in chips)
Seat 3: StevieD. (1360 in chips)
Seat 4: Lanc02061 (4870 in chips)
Seat 5: dutchsam (910 in chips)
Seat 6: Kreskin (1570 in chips)
Seat 8: richie200 (730 in chips)
Seat 9: carbonstu (1290 in chips)
Seat 10: TEXAN2000 (1290 in chips)
TEXAN2000: posts small blind 15
jaynos: posts big blind 30
----- HOLE CARDS -----
dealt to Stev04055 [Qs 8s]
Stev04055: folds
StevieD.: folds
Lanc02061: calls 30
dutchsam: calls 30
Kreskin: calls 30
richie200: raises to 730 and is all-in
carbonstu: folds
I have a simple task, but after a few hours of searching, cannot spot the answer, which I am sure is obvious.
I have PERL running on WinXP and I have text files like that shown at the bottom stored in MS Word.
I would like to read each line into a variable and then use regex to search for a string and extract the info. contained - it's a list of poker hands, so I want to know which hands I played, what was the result etc.
Question is what marks the line boundary - my little script seems to read about 20lines as one string, instead of each. In word, the end of each line seems to have a paragraph mark, but I can't search and replace for the ^p so, the only real paragraph mark is the one at the end of the document. NB. In word the following are displayed on consecutive lines, not with a double-line space as marked-up here.
What do I need to do to make PERL recognise the end of a line? In my little PERL book all the examples talk about manually inputted text, and not text read from a .txt file or something similar.
Thanks in advance for your help!
P.
------HAND 1------
Game #871100404: Texas Hold'em No Limit (15/30) - 2005/09/11 - 21:14:01 (UK)
Table "Tourney 1066310 - 21" Seat 9 is the button.
Seat 1: jaynos (1500 in chips)
Seat 2: Stev04055 (1480 in chips)
Seat 3: StevieD. (1360 in chips)
Seat 4: Lanc02061 (4870 in chips)
Seat 5: dutchsam (910 in chips)
Seat 6: Kreskin (1570 in chips)
Seat 8: richie200 (730 in chips)
Seat 9: carbonstu (1290 in chips)
Seat 10: TEXAN2000 (1290 in chips)
TEXAN2000: posts small blind 15
jaynos: posts big blind 30
----- HOLE CARDS -----
dealt to Stev04055 [Qs 8s]
Stev04055: folds
StevieD.: folds
Lanc02061: calls 30
dutchsam: calls 30
Kreskin: calls 30
richie200: raises to 730 and is all-in
carbonstu: folds