restrict line range problem
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
restrict line range problem
Hi,
Please help, whether I have encountered a bug or I have used a wrong filter (textpipe pro 7.2).
File 1:
CR:123
field 1, field 2, field3
field 11, field 22, field33
File 2:
CR:123
Filter:
>append footer "N, no result found"
>restrict to line 3 to end - 0
>> remove line matching "N, no result found"
I run the filter on all files at once, Result:
File 1:
CR:123
field 1, field 2, field3
field 11, field 22, field33
File 2:
CR:123
N, no result foundfield 1, field 2, field3
field 11, field 22, field33
Regards
Please help, whether I have encountered a bug or I have used a wrong filter (textpipe pro 7.2).
File 1:
CR:123
field 1, field 2, field3
field 11, field 22, field33
File 2:
CR:123
Filter:
>append footer "N, no result found"
>restrict to line 3 to end - 0
>> remove line matching "N, no result found"
I run the filter on all files at once, Result:
File 1:
CR:123
field 1, field 2, field3
field 11, field 22, field33
File 2:
CR:123
N, no result foundfield 1, field 2, field3
field 11, field 22, field33
Regards
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Hi,
here are the filter, source file, output files :-
TextPipe Single User Edition
Purchased by: wing, Azeus Systems Limited
Filter Title:
Filter List
-----------
Filter options
| [ ] Log to file
| [X] Append to logfile
| Log filename: textpipe.log
| Threshold 500
|
|--Input from file(s)
| [ ] Confirm before processing each file
| [ ] Confirm before processing read/only files
| [ ] Delete input files after processing
| Process binary files
|
|--Comment...
| | 6. Insert "No call made OR ported out"
| |
| |--Add footer [N,No call made OR ported out,]
| |
| +--Restrict lines:Line 3 .. line END - 0
| |
| +--Remove matching lines [N,No call made OR ported out,]
| [ ] Include line numbers
| [ ] Include filename
| [ ] Match case
| [ ] Count matches
| Pattern type: 4
| Context before: 0
| Context after: 0
|
+--Output to file(s)
[ ] Only update date on changed files
[ ] Keep original file's date and time
[ ] Append mode
[X] Change extension to: .cr2
Output folder: C:\
[X] Maintain folder structure
Files List
----------
c:\estar\sp_root\result\*.cr
Source File 1: a.cr
CR:90101111
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
Source File 2: b.cr
CR:90101111
Output File 1: a.cr2
CR:90101111
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
Output File 2: b.cr2
CR:90101111
N,No call made OR ported out,,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
here are the filter, source file, output files :-
TextPipe Single User Edition
Purchased by: wing, Azeus Systems Limited
Filter Title:
Filter List
-----------
Filter options
| [ ] Log to file
| [X] Append to logfile
| Log filename: textpipe.log
| Threshold 500
|
|--Input from file(s)
| [ ] Confirm before processing each file
| [ ] Confirm before processing read/only files
| [ ] Delete input files after processing
| Process binary files
|
|--Comment...
| | 6. Insert "No call made OR ported out"
| |
| |--Add footer [N,No call made OR ported out,]
| |
| +--Restrict lines:Line 3 .. line END - 0
| |
| +--Remove matching lines [N,No call made OR ported out,]
| [ ] Include line numbers
| [ ] Include filename
| [ ] Match case
| [ ] Count matches
| Pattern type: 4
| Context before: 0
| Context after: 0
|
+--Output to file(s)
[ ] Only update date on changed files
[ ] Keep original file's date and time
[ ] Append mode
[X] Change extension to: .cr2
Output folder: C:\
[X] Maintain folder structure
Files List
----------
c:\estar\sp_root\result\*.cr
Source File 1: a.cr
CR:90101111
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
Source File 2: b.cr
CR:90101111
Output File 1: a.cr2
CR:90101111
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
Output File 2: b.cr2
CR:90101111
N,No call made OR ported out,,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
,,,,,90101111,,,,,,2005-02-03,12:54:51,,000008,,,21,,,191390165637,,,,,
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
I want to add the line "N,No call made OR ported out" if the file contains no lines except the header line. where the header line may change from file to file, but there is only 1 header line for each file.
so the result, i'm expecting is:
File 1 - no change
File 2 - the line "N,No call made OR ported out" is append at the end.
Regards.
so the result, i'm expecting is:
File 1 - no change
File 2 - the line "N,No call made OR ported out" is append at the end.
Regards.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Why not add that line always, and then remove it with a simple pattern search/replace?
Search for EasyPattern:
[ capture(2 or more (lines )) ]N,No call made OR ported out
Replace with
$2
You might need to tweak the pattern a little. Files with only a header line will NOT match the pattern, and hence your footer line will remain.
Search for EasyPattern:
[ capture(2 or more (lines )) ]N,No call made OR ported out
Replace with
$2
You might need to tweak the pattern a little. Files with only a header line will NOT match the pattern, and hence your footer line will remain.