So, i have a text file. The purpose is to Add VBCRLF (newline) in certain part of string . 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-}
Expected condition:
if we see on notepad ++ will look like this (make sure you’re enable the symbols)
You would need to use 3 “Find Matching Patterns”, to get 3 collections strings you want to replace.
In the “For Each” you could have 1 Multiple assign to replace the text with: “Text.Replace(currentItem.ToString,currentItem.ToString + " \n”)" where “\n” could also be “vbLf”.
If your patterns work, you can use them, else you could do:
\{[0-9]{1,2}\: ← Depending if your Patterns can have 2 numbers, else you can drop {1,2}
\:[0-9]{2}\: ← to find patterns like “:nn:”
\/[A-Z]*\/ ← to find patterns like /TEXT/ (My understanding was only uppercase characters?
Hope that helps.
Kind Regards
Edit: added extra \ because they wouldnt show otherwise