BAT:0310:2009-08-0:Y4 :H:D:00003721:03103721.IFH:00138770:05767:
00000000001279'
EXR:CLP:912.570000'
STA:A:9071559:2009-08-10::Ward::Mrs'
DEF::531.97:531.97:310221661617::+ABC:BAL:1:N::::5:40.00:0.00:2009-08-10:CN:11627877495099621::3:N:missc :N:PH:00010833:
0001+ABC:FPT:4:N::::5:19.99:0.00:2009-08-10:CN:1162 7987 9509 9621::3:N:miss c ross:N:AI:00220600:S3IA'
VDI:2004-03-12:133030431725:4:M:00001912:AT:BSP:9124029676:2004-05-06:Parker:4:12:::::I:::::N::129.00:129.00
:1234567887234567678:0:155.40::6:::::+TAX:UB:6.30+TAX:XT:15.10'
CTR:2009-08-10:0.00:0.00:30.00:30.00:7819.00:7819.00'
GTR:11.50:0.00:0.00:28457.81:149449.38:21298.48:154882.82:1725.89'
TRA'
i have a txt file as above and i need to mask the middle digits of the credit card num such that only the first 6
and last 4 are visible.
The credit card number appear in 12th position in +ABC segment separted by :
( the 12th position can have other things also apart from the credit card which shouldn't be masked) the way to
identify credit card num is the field before it that is the 11 field in ABC section is having any of these values
TXE,AF,XT,TT,IT,TX,DX,TY,DT,MO,SE,CF,AXE,DF,CX,TF,DE,XF,CNE,IX,CN,SC,XTE,AX,CX
then credit card is in 12th position and needs to masked
The credit card can be of varying digits (16, 17, 19.........) and they can digits of credit card can appear
together or with space
The credit card number also appear in 26th position in VDI segment separated by :
eg
1162 7987 9509 9621
1162798795099621
1162 7987 9509 9621 1234
11627987950996211234
The output needs to be
1162 79********9621
116279******9621
1162 79*************1234
116279**********1234
i used the above code as posted in my above post but it didn't
have the functionality of varying digits and the 11th field check of ABC section.
Please Advice how to achieve the above.