Problem with "Capture to variable" filter

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

User avatar
Fixer
Posts: 22
Joined: Thu Jul 31, 2008 6:39 am
Location: European Union > Poland
Contact:

Problem with "Capture to variable" filter

Postby Fixer » Sun Jul 10, 2011 9:18 pm

How to change filter below to get expected result?

Trial input:
REM "B0001"
a1|b1
a2|b2
a3|b3
a4|b4
a5|b5
a6|b6
REM "B0002"
a1|c1
a2|c2
a3|c3
REM "B0003"
REM "B0004"

Trial output
REM "B0001"
a1|B0004
a2|B0004
a3|B0004
a4|B0004
a5|B0004
a6|B0004
REM "B0002"
a1|B0004
a2|B0004
a3|B0004
REM "B0003"
REM "B0004"

Result expected
REM "B0001"
a1|B0001
a2|B0001
a3|B0001
a4|B0001
a5|B0001
a6|B0001
REM "B0002"
a1|B0002
a2|B0002
a3|B0002
REM "B0003"
REM "B0004"

My filter:

Code: Select all

TextPipe Server Edition
Purchased by: ___

Filter Title: C:\test.fll

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
|     Skip binary files
|       Sample size 100 characters
|   
|--Perl pattern [^REM "(B\d+)"$] with []
|  |  [X] Match case
|  |  [ ] Whole words only
|  |  [ ] Case sensitive replace
|  |  [ ] Prompt on replace
|  |  [ ] Skip prompt if identical
|  |  [ ] First only
|  |  [ ] Extract matches
|  |  Maximum text buffer size 9999999
|  |  [ ] Maximum match (greedy)
|  |  [ ] Allow comments
|  |  [ ] '.' matches newline
|  |  [ ] UTF-8 Support
|  |
|  +--Capture to variable @pacjent
|      Reset: 3
|     
|--Perl pattern [^(.*)\|(.*)$] with [$1|@pacjent]
|     [ ] Match case
|     [ ] Whole words only
|     [ ] Case sensitive replace
|     [ ] Prompt on replace
|     [ ] Skip prompt if identical
|     [ ] First only
|     [ ] Extract matches
|     Maximum text buffer size 9999999
|     [ ] Maximum match (greedy)
|     [ ] Allow comments
|     [ ] '.' matches newline
|     [ ] UTF-8 Support
|   
+--Output to file(s)
      [ ] Only update date on changed files
      [ ] Append mode
      [ ] Change extension to: .txt
      [ ] Open output file
    Only output modified files    Backup mode      [ ] Remove empty output files   

Files List
----------

User avatar
DataMystic Support
Site Admin
Posts: 2164
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Problem with "Capture to variable" filter

Postby DataMystic Support » Mon Jul 18, 2011 11:51 am

Add a Filters\Restrict\Each line in turn, and drag all your filters inside it. This forces the capture to match each line one at a time.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

User avatar
Fixer
Posts: 22
Joined: Thu Jul 31, 2008 6:39 am
Location: European Union > Poland
Contact:

Re: Problem with "Capture to variable" filter

Postby Fixer » Tue Jul 19, 2011 11:11 am

thx it works fine :)
Attachments
CaptureText.rar
Capture Text to variable
(788 Bytes) Downloaded 332 times


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider] and 8 guests