Hello
I have filter:
“Select all lines from the start of the file until a line starting with DeliveredDate:”
My question is: how to delete all matching lines (instead of changing them into upper case - as is default now).
I've used subfilter Remove all, but it doesn't work. So: how to delete all matching (to the line: "DeliveredDate:") lines?
Please, give me filter:
“DELETE all lines from the start of the file until a line starting with DeliveredDate:”
Best regards!
Peter
Select all lines from the start... and delete them all
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Hello!
First, I use normal Your VBScript script:
But, please, tell me, what kind of (sub)filter - (sub)command - should I use (instead of default: Convert to UPPERCASE) in order to DELETE all matching lines, it is: form the start of the file until a line starting with DeliveredDate:
Thank You in advance!
Peter
First, I use normal Your VBScript script:
Code: Select all
Filter List
-----------
|--VBScript script Timeout: 10000 milliseconds
| | 'Select all lines from the start of the file until a line starting with DeliveredDate:
| |
| | dim textFound
| |
| | 'Called for every line in the file
| | 'EOL contains the end of line characters (Unix, DOS or Mac) that must be
| | 'appended to each line
| | function processLine(line, EOL)
| |
| | if InStr( line, "DeliveredDate:" ) = 1 then
| | textFound = true
| | end if
| |
| | if not( textFound ) then
| | processLine = TextPipe.subFilterEntireText(line) & EOL
| | else
| | processLine = line & EOL
| | end if
| |
| | end function
| |
| |
| | 'Called before each file is opened -
| | 'perform per-file initialisation here
| | function startFile()
| | textFound = false
| | startFile = ""
| | end function
| |
| |
| | 'Called before each file is closed -
| | 'flush all pending file output here
| | function endFile()
| | endFile = ""
| | end function
| |
| |
| | 'Called at the start of a processing job -
| | 'perform one-time initialisation here
| | sub startJob()
| | 'do nothing
| | end sub
| |
| |
| | 'Called at the end of a processing job -
| | 'destroy any declared objects here
| | sub endJob()
| | 'do nothing
| | end sub
| |
| |
| |
| +--Convert to UPPERCASE [THERE IS THE CRUCIAL ELEMENT]
|
+--Output to file(s)
But, please, tell me, what kind of (sub)filter - (sub)command - should I use (instead of default: Convert to UPPERCASE) in order to DELETE all matching lines, it is: form the start of the file until a line starting with DeliveredDate:
Thank You in advance!
Peter
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
That VBScript code will not work.
Use this simple search/replace filter instead:
Use this simple search/replace filter instead:
Code: Select all
Perl pattern [(.*)(^DeliveredDate:)] with [$2]
[ ] Match case
[ ] Whole words only
[ ] Case sensitive replace
[ ] Prompt on replace
[ ] Skip prompt if identical
[ ] First only
[ ] Extract matches
Maximum text buffer size 409600
[ ] Maximum match (greedy)
[ ] Allow comments
[X] '.' matches newline
[ ] UTF-8 Support
Thank You, it works indeed, but by the use of the filter:
“select from start to matching line.fll”
tasks could by done more sophisticated, even: faster.
The one thing what the User need is filter:
“remove from start to matching line.fll”
(and – prospectively: “remove from matching line to the end of file.fll”)
but today (7.6.1) there is no such filter(s).
Anyway: Your regex-tip is working. Thank you once more!
Bye, bye.
“select from start to matching line.fll”
tasks could by done more sophisticated, even: faster.
The one thing what the User need is filter:
“remove from start to matching line.fll”
(and – prospectively: “remove from matching line to the end of file.fll”)
but today (7.6.1) there is no such filter(s).
Anyway: Your regex-tip is working. Thank you once more!
Bye, bye.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact: