Capture to variable
Posted: Mon Aug 12, 2013 7:54 am
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
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