Extract number from .txt File & Rename

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

MillerTimeHI
Posts: 2
Joined: Thu Jul 24, 2008 2:18 pm

Extract number from .txt File & Rename

Postby MillerTimeHI » Thu Jul 24, 2008 3:01 pm

I need to extract a number from text files (HL7 v2.3 Healthcare files if anyone is familiar) and rename the file based on that number. Below is an example and the number I need to extract (AcctNum) is located where the 88888888 is. The number of text pipes will always be the same, the AcctNum will always be in the 19th position within the the line segment, which will always start with PID.

MSH|^~\&|SENDINGAPP|45|RECEIVINGAPP|HOSP|20080531210531||ADT^A03|Q123459789T123456789|P|2.3
EVN|A03|20080531210500|||ABC1234^DOE, RN^JANE^A^^^^^^CD:123456
PID|1|1234567|123456|12345|MOUSE^MINNY^J||12345678000000|F||H|1234 1ST AVE^^DISNEY WORLD^FL^99999||8005551234|8005551234|ENG|M|XYZ|88888888|123456789||||FLORIDA||0

I am not a programmer and will appreciate any help you can give me!

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

Re: Extract number from .txt File & Rename

Postby DataMystic Support » Fri Jul 25, 2008 9:42 pm

You need to first use a pattern match to extract this field and save it in a global variable.

Then use a scripting filter to capture all the data and save it to a new file using the FileSystem object.
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

MillerTimeHI
Posts: 2
Joined: Thu Jul 24, 2008 2:18 pm

Re: Extract number from .txt File & Rename

Postby MillerTimeHI » Fri Aug 01, 2008 7:44 am

Could you please provide me an example of how to do this with your program & the script? I tried to do it on my own but am still struggling. I would appreciate help from any of you hard working programmers; I'm sure this is simple in your world. Thx.

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

Re: Extract number from .txt File & Rename

Postby DataMystic Support » Fri Aug 01, 2008 12:09 pm

We'd have to do this as a small consulting job - no more than 1 hour. Please drop us an email if you'd like to do so.
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


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

Who is online

Users browsing this forum: No registered users and 4 guests