Help with a DOS Batch to Rename Text String in EDI Import Do

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jcubed1959
Posts: 1
Joined: 06 Jul 2015 13:18

Help with a DOS Batch to Rename Text String in EDI Import Do

#1 Post by jcubed1959 » 06 Jul 2015 13:25

Hello,


I'm apologize for the long post. I need some help with a DOS batch file that can do the following:


1. Find a text string in one or many EDI 856 Import(s) (.txt) file(s) in a Windows 7 file system folder, e.g,. C:\ABCCOMANY\INBOX.
The text string can be one of three possible codes and the string is always 7 alphanumeric characters long, e.g., ABC1234.
Please refer to the second element of the GS Segment, i.e., ABC1234, in the BEFORE Example.


2. Find another text string in the same EDI 856 Import (.txt) files, that is a static 10 digit numeric phone number, e.g., 1234567890.Note the sixth element must always be 15 characters in length between the delimiter, i.e., * (asterisk)
Please refer to the sixth element of the ISA segment in the BEFORE Example.


3. Replace the static phone number in element six of the ISA Segment, e.g., *1234567890 *, with the second element of the the GS Segment, e.g., *ABC1234*.
Refer to the second element of the GS segment in the AFTER Example and the .


BEFORE Example

ISA*00* *00* *12*1234567890 *ZZ*ABCCOMPANY *150624*0921*U*00401*999999898*0*P*>~
GS*SH*ABC1234*ABCCOMPANY*20150624*0921*8*X*004010~


AFTER

ISA*00* *00* *12*1234567890 *ZZ*ABC1234 *150624*0921*U*00401*999999898*0*P*>~
GS*SH*ABC3000*ABCCOMPANY*20150624*0921*8*X*004010~


Any assistance would be greatly appreciated.

Thank you,

Johnless

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Help with a DOS Batch to Rename Text String in EDI Impor

#2 Post by foxidrive » 06 Jul 2015 22:12

See here for some tips: viewtopic.php?f=3&t=6108

Post Reply