aspose file tools*
The moose likes Java in General and the fly likes Regular Expression Find line(s) and delete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Regular Expression Find line(s) and delete" Watch "Regular Expression Find line(s) and delete" New topic
Author

Regular Expression Find line(s) and delete

Gobenath
Greenhorn

Joined: Feb 05, 2002
Posts: 1
Hello
I am new to RegularExpression. I have x12 format input file(see below). I need to eleminate the highlighted lines and join the other lines. Anyone has an idea how to make regex for this?

Input:
ISA*00* *00* *ZZ*00390 *ZZ*621249087 *111018*2026*^*00501*000000001*0*P*:~GS*FA*00390*621249087*20111018*2026*1*X*005010X231A1~ST*999*0001*005010X231A1~AK1*HR*146542*005010X212~AK2*276*0001*005010X212~IK5*A~AK2*276*0002*005010X212~IK5*A~AK2*276*0003*005010X212~IK3*SVC*15*2210*8~CTX*TRN02:BX89900908140602174870000~IK4*1:2*234*1~IK4*1::2*3*12~IK4*1:1*235*5*98941~IK4*1:1*235*7*98941~IK4*1:2*234*1~IK3*DTP*15*2210*I6~CTX*TRN02:BX89900908140602174870000~IK5*R*5*I5~AK2*276*0004*005010X212~IK5*A~AK2*276*0005*005010X212~IK5*A~AK2*276*0006*005010X212~IK5*A~AK2*276*0007*005010X212~IK5*A~AK2*276*0008*005010X212~IK5*A~AK2*276*0009*005010X212~IK5*A~AK2*276*00010*005010X212~IK5*A~AK2*276*00011*005010X212~IK5*A~AK2*276*00012*005010X212~IK5*A~AK2*276*00013*005010X212~IK5*A~AK2*276*00014*005010X212~IK5*A~AK2*276*00015*005010X212~IK5*A~AK2*276*00016*005010X212~IK5*A~AK2*276*00017*005010X212~IK5*A~AK2*276*00018*005010X212~IK5*A~AK2*276*00019*005010X212~IK5*A~AK2*276*00020*005010X212~IK5*A~AK2*276*00021*005010X212~IK5*A~AK2*276*00022*005010X212~IK5*A~AK2*276*00024*005010X212~IK3*BHT*2**8~IK4*5*337*I9~IK3*REF*16*2200*1~CTX*TRN02:BX41111012141711303080000~IK5*R*I5*5~AK2*276*00027*005010X212~IK5*A~AK2*276*00028*005010X212~IK5*A~AK2*276*00029*005010X212~IK5*A~AK9*P*26*26*24~SE*69*0001~GE*1*1~IEA*1*000000001~";


Regards<br />Gopinath
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regular Expression Find line(s) and delete