Remove String

Hello Guys,

I want to remove any data before SWIFT.

Saffy Number: X0278623
Saffy Timestamp: 28/04/2020 01:50:02 PM

Swift:
{1:F01RSSDFESXXXX8019248526}{2:O1030914190628BOFAUS60ZSFX25460652341906281814N}{3:{108:P491790268041}{121:d64f618e-99bf-41e9-9eef-76ed6d62e1aa}}{4:
:20:P49179026804
:23B:CRED
:23E:CORT
:32A:200428ZAR3934,72
:33B:ZAR3531,72
:50K:/5800259201
WORLD FUEL SERVICES, INC
9800 NW 41ST STREET, SUITE 400 MIAM
I, FL 33178 US
33178, US
:52A:RCHDBAU60SFX
:53B:/198600000
:57A:FIRCDFSN0XXX
:59:/62241306613
SOUTHERN ENERGY COMPANY
CITY UNKNOWN NA
NA
:70:REF:196SA33454NQ3I80 /RFB/920
969 INV IN376691 NOTE JET FUEL
:71A:OUR
:72:/RECEVRES/NA
-}

@amritr
give a try on regex


Kindly note: set the modifier to singleline

1 Like

Put this string in a variable say str_test
then use

str_test.Substring(str_test.IndexOf(“Swift”))

2 Likes

Hello @amritr,

You can use matches activity,
set match property to :- (?=Swift)[\s\n0-9A-Za-z:{},.!@#$%^&*()_-=+]+.*

2 Likes

Thanks for the solution. it worked for me… Although can you please guide me I want to replace text corresponding to :32A as current date in yyMMdd format, and reaming characters as is.

Swift:
{1:F01NEDSZAJ0XXXX6765491866}{2:O1031339190711IRVTUS30IXXX28278072601907111340N}
{3:{103:ZDS}{113:3110}{108:JA79D3931KSF1U0P}{119:STP}{111:001}{121:d1e00441-1e33-4111-ae66-e52f48af8cf6}{115:JA79D3931KSF1U0P}}
{4:

:20:TRFRECPAY0215485

:23B:CRED

:32A:200428ZAR2784,00

:33B:ZAR1455,00

:50K:/04554899000106
MERYL AMRITRAIKRUGER
CIF-75225826000002
NEW YORK NYC
UNITES STATES

:52A:/IRVTUS30

:57A:SBZAZAJ0
:
59:/1026070348
FREDERICK MICHEL BEHR
37 FICHARDT STREET SASOLBURG
SOUTH AFRICA
ZA

:70:TRF TO BANK ACCOUNT

:71A:BEN

:71F:USD0,
-}

Use
Variable.Replace(":32A",Date.Now.ToString(“yyMMdd”))

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.