i am new to this forum cause i need help. I have done many scripts.
but i want to use perl to do this:
What I want to do is this. I have a QRP file that I can convert to a txt file field separated by commas or not. I want to pring each line that has an actual date to the right of the word 'DATE:' if it doesnt have a date do not print that line.
Then the next thing i want my perl program to do is print each line that has
a numerical match. Print all fields in that line. What it is is a keyless entry
data file. People come into this gym i attend and it logs the date once for that day and then keeps track of each time someone uses the keyless entry. Shows the time and some words and then their mbr number and then their name. like this
--------------------------
Expand|Select|Wrap|Line Numbers
- Date: 01/07/2008
- 3:45AM 1 Door One blah blah blah: 23 John Doe
- 4:45AM 1 Door One blah blah blah: 299 Jerry Doe
- 5:45AM 1 Door One blah blah blah: 223 Sissy Doe
- Date: 01/08/2008
- 3:45AM 1 Door One blah blah blah: 23 John Doe
- 4:45AM 1 Door One blah blah blah: 299 Jerry Doe
- 5:45AM 1 Door One blah blah blah: 223 Sissy Doe
- 7:45PM 1 Door One blah blah blah: 23 John Doe
that is querried by their member number before their name and then gives
and out put like this: So the user puts in the member number of 23 and gets below text file. It searches entire file above.
Expand|Select|Wrap|Line Numbers
- Date: 01/07/2008
- 3:45AM 1 Door One blah blah blah: 23 John Doe
- Date: 01/08/2008
- 3:45AM 1 Door One blah blah blah: 23 John Doe
- 7:45PM 1 Door One blah blah blah: 23 John Doe
read data.txt
print Date and actual date if date is to the right of the word Date:
(some lines with Date: do not have a date to the right; do not want to print nothing)
Print entire line that has member number that you are searching in only print
this entire line and go on to the next line searching for member number in that line and print that line tooo.
Do this until EOF.
can anyone help me I have a clue but need to get some good code.
I know you guys do it all the time and would appreicate your guidance.
or a great reference to doing this.
i have messed with code like in C++ but I would like to use perl to do this.
I think it can.
thanks
Robert ;)