Regular Expression Programming
4799
$$
- Posted:
- Proposals: 9
- Remote
- #57905
- Archived
Web Software Engineer - scrapping, parsing, query, CSV, JSON, regex, vue, data visualization
Singapore
1294053515265929769459927312934107320142786145497
Description
Experience Level: Intermediate
Create two PCRE Regular Expressions which do the following:
1. Find a line that begins with "ROYALTY PAYMENTS DUE REPORT"
2. Delete that line plus the next 8
3. Do 1. and 2. above until the end of the file
And another which will:
4. Go to the top of the file
5. Delete all lines starting at the current line until you get to a line that begins "Payment Due:"
6. Move down a line.
7. If the current line begins with "Total Payment Due for " then move down one line, otherwise repeat steps 5. and 6.
Another way to describe this: I want to be left with a file in the same order as the current file that only has the lines that begin with "Royalty ID:", "Payment Due:", and "Total Payment Due for". See the example in Sample.txt.
1. Find a line that begins with "ROYALTY PAYMENTS DUE REPORT"
2. Delete that line plus the next 8
3. Do 1. and 2. above until the end of the file
And another which will:
4. Go to the top of the file
5. Delete all lines starting at the current line until you get to a line that begins "Payment Due:"
6. Move down a line.
7. If the current line begins with "Total Payment Due for " then move down one line, otherwise repeat steps 5. and 6.
Another way to describe this: I want to be left with a file in the same order as the current file that only has the lines that begin with "Royalty ID:", "Payment Due:", and "Total Payment Due for". See the example in Sample.txt.
Robert R.
0% (0)Projects Completed
1
Freelancers worked with
1
Projects awarded
33%
Last project
16 Feb 2011
United States
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies