Extract number from .txt File & Rename

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

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

Extract number from .txt File & Rename

Post by MillerTimeHI »

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: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Extract number from .txt File & Rename

Post by DataMystic Support »

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.
MillerTimeHI
Posts: 2
Joined: Thu Jul 24, 2008 2:18 pm

Re: Extract number from .txt File & Rename

Post by MillerTimeHI »

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: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Extract number from .txt File & Rename

Post by DataMystic Support »

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.
Post Reply