So, i have a text file. The purpose is to Add VBLF (newline) in certain part of string using VB.net. Here the example of the string:
Before (The string don't have any newline caharcter):
{1:F01ABCDIDJAXXXX0001212544}{2:O9001038231020QWERIDJRAXXX00011102422310201038N}{3:{113:0070}}{4::20:94493831555385/900:21:0799102034308001:25:520008000990:32A:231020USD0,:72:/ESETDATE/2310201038+0000/OID/231020ABCDDJAXXXX0001019040/AMNT/10000000000001,12-}
After:
if we see on notepad ++ will look like this open image here
I was think that we need to iterate through each character. Below is my logic:
1.Find character
{4:
in whole string, then replace with {4: + vbLf
- Replace regex
For each character with pattern
^:[\d\w]+:
(like :20: ) Then replace with vbLf + originalcharacter
- Replace regex
For each character with pattern
/(.*?)/
(like \AMNT\ )
Then replace with vbLf + originalcharacter
If anyone can help to solve this, appreciate it. Thanks
Here is one possible solution without using regex: