I am using the Capture to variable as a Sub-filter for Restrict columns. The problem I am having is that it is only capturing data from the last line as it was explained below:
I am a little confuse what I need to add for the filter to not only look at the last line of recorder, but all the records.
the help file states:
"It is VERY important to understand how TextPipe processes data to use this filter successfully. For most applications, this will involve placing this filter inside a Restrict to each line in turn filter. If you do not, the text captured will most likely be the very last value found in the file. If you have any questions about this, please contact us."
my script below:
Filter Title: C:\cg\ssa1c.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
| Process binary files
|
|--Convert End of Lines - Unix to DOS
| [X] Remove bad EOL
|
|--Comment...
| | Grab blocks from input
| |
| |--Comment...
| | | Grab data from each block and put into variables
| | |
| | |--Comment...
| | | | Phone
| | | |
| | | +--Restrict columns:Column 579 .. column 590
| | | |
| | | +--Capture to variable @phone
| | | Reset: 1
| | |
| | |--Comment...
| | | | Facility
| | | |
| | | +--Restrict columns:Column 455 .. column 457
| | | |
| | | +--Capture to variable @facility
| | | Reset: 1
| | |
| | |--Comment...
| | | | Patient
| | | |
| | | +--Restrict columns:Column 10 .. column 50
| | | |
| | | +--Capture to variable @patient
| | | Reset: 1
| | |
| | |--Comment...
| | | | clientaccount
| | | |
| | | +--Restrict columns:Column 189 .. column 198
| | | |
| | | +--Capture to variable @clientaccount
| | | Reset: 1
| | |
| | |--Comment...
| | | | NameOnCard
| | | |
| | | +--Restrict columns:Column 120 .. column 150
| | | |
| | | +--Capture to variable @nameoncard
| | | Reset: 1
| | |
| | |--Comment...
| | | | cardtype
| | | |
| | | +--Restrict columns:Column 165 .. column 175
| | | |
| | | +--Capture to variable @cardtype
| | | Reset: 1
| | |
| | |--Comment...
| | | | cardno
| | | |
| | | +--Restrict columns:Column 287 .. column 310
| | | |
| | | +--Capture to variable @cardno
| | | Reset: 1
| | |
| | |--Comment...
| | | | cardseccode
| | | | //this not working correctly
| | | |
| | | +--Restrict columns:Column 307 .. column 310
| | | |
| | | +--Capture to variable @cardseccode
| | | Reset: 1
| | |
| | |--Comment...
| | | | cardexpdate
| | | |
| | | +--Restrict columns:Column 426 .. column 434
| | | |
| | | +--Capture to variable @cardexpdate
| | | Reset: 1
| | |
| | |--Comment...
| | | | chargeamt
| | | |
| | | +--Restrict columns:Column 552 .. column 566
| | | |
| | | +--Capture to variable @chargeamt
| | | Reset: 1
| | |
| | |--Comment...
| | | | address
| | | |
| | | +--Restrict columns:Column 382 .. column 412
| | | |
| | | +--Capture to variable @address
| | | Reset: 1
| | |
| | +--Comment...
| | | citystatezip
| | |
| | +--Restrict columns:Column 505 .. column 535
| | |
| | +--Capture to variable @citystatezip
| | Reset: 1
| |
| +--Comment...
| | Replace block with record
| |
| |--Remove all
| |
| +--Add footer [@phone\t@facility\t@patient\t@clientaccount\t@nameoncard\t@cardtype\t@cardno\t@cardseccode\t@cardexpdate\t@chargeamt\t@address\t@citystatezip]
|
|--Comment...
| | Add field names to top of file
| |
| |--Add header [phone\tfacility\tpatient\tclientaccount\tnameoncard\tcardtype\tcardno\tcardseccode\tcardexpdate\tchargeamt\taddress\tcitystatezip]
| |
| +--Remove blanks from End of Line
|
+--Merge output to file C:\Users\CC\Jc.csv
Files List
----------
F:\QSYSPRT.txt
Capture to variable
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
-
- Posts: 11
- Joined: Wed Apr 03, 2013 4:40 am
Re: Capture to variable
I solved the problem... I am going to leave this alone just incase someone else maybe having the same problem...
To make this work, you would need to add the restrict filter "Each line in turn", then make all your restrict filters a subfilter... in other words, simple drag all your filter under Each line in turn... and this should work...
To make this work, you would need to add the restrict filter "Each line in turn", then make all your restrict filters a subfilter... in other words, simple drag all your filter under Each line in turn... and this should work...
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Capture to variable
Yes! Exactly as it says in the help file!
Remember, unless you tell it otherwise, TextPipe will process the entire file through one filter before passing it to the next filter. So the Capture only gets the last line of the file, but by forcing it to use one line at a time, it is able to capture the text and use it repeatedly.
Remember, unless you tell it otherwise, TextPipe will process the entire file through one filter before passing it to the next filter. So the Capture only gets the last line of the file, but by forcing it to use one line at a time, it is able to capture the text and use it repeatedly.