AnsweredAssumed Answered

Modifying EDI

Question asked by ram.muddana501196 on Mar 21, 2016
Latest reply on Mar 23, 2016 by nancy_kenney

hi,

     I have an EDI document

***************************************

ISA*00*   *00*   *ZZ*MIXINC     *01*006919ECG   *160223*1435*U*00401*000000361*0*P*>

GS*PO*NIX*006919ECG*20160223*1435*361*X*004010

ST*850*0002

BEG*00*SA*SO-005251**20160219

REF*CO*103301332351

REF*IL*2126921

REF*PO*PO-013774

DTM*001*20160219

TD5*****MainFreight: 3 Day***MainFreight: 3 Day

N1*ST*CAM ASSOCIATES LLC*92*593873

N3*21721 FILI COURT*SUITE B

N4*ASHBURN**20147*US

PER*SH*Eric Bediako*TE*1 703-526-4467

PO1*1*1*EA*17566.5*TE*VN*NI-3460-G4-2680v3*PO*PO-013774

PO1*2*64*EA*184.1*TE*VN*C-MEM-32GB-DDR4-R*PO*PO-013774

PO1*1*1*EA*10000*VN*UNODE-XXX*PO-13774

CTT*18

SE*25*0002

****************************************

 

I need to check for NI or UNODE in the PO1 section of the document and add a new line above

 

***************************************

ISA*00*   *00*   *ZZ*MIXINC     *01*006919ECG   *160223*1435*U*00401*000000361*0*P*>

GS*PO*NIX*006919ECG*20160223*1435*361*X*004010

ST*850*0002

BEG*00*SA*SO-005251**20160219

REF*CO*103301332351

REF*IL*2126921

REF*PO*PO-013774

DTM*001*20160219

TD5*****MainFreight: 3 Day***MainFreight: 3 Day

N1*ST*CAM ASSOCIATES LLC*92*593873

N3*21721 FILI COURT*SUITE B

N4*ASHBURN**20147*US

PER*SH*Eric Bediako*TE*1 703-526-4467

PO1**1*EA*0*TE*VN*FILLER

PO1*1*1*EA*17566.5*TE*VN*NI-3460-G4-2680v3*PO*PO-013774

PO1*2*64*EA*184.1*TE*VN*C-MEM-32GB-DDR4-R*PO*PO-013774

PO1**1*EA*0*TE*VN*FILLER

PO1*1*1*EA*10000*VN*UNODE-XXX*PO-13774

CTT*18

SE*25*0002

****************************************

1st option

I tried splitting the doc based on each line , search for the string and add a new line with Filler data

 

2nd option

 

I tried splitting the doc based on EDI with PO1 as link element and searched for the string

 

both options I could not generate the output file as expected. Can anyone help me with this.

Outcomes