Microsoft
Software
Hardware
Network
Question : Regular Expression needed to parse a string of multiple colons and extract an element-revised
I am parsing a txt file that has 100's of lines like:
line 1:
ACH CREDIT RECEIVED - Cust ID: 82251432 Desc: ATM PAYMNT Comp Name: FDRETAILATM 0611 Comp ID: 0123456780 Batch Discr:ATM PROCESSING SEC: PPD Cust Name: SAMJONESLANDRY HQ Addenda: No Addenda
capture only the 82251432
line2:
ACH CREDIT RECEIVED - Cust ID: BMG2 741529 Desc: EBSETL0611 Comp Name: BLEHLLC Comp ID: 1234567898 SEC: CCD Cust Name: SAMJONESLANDRY 409 Addenda: No Addenda
capture only the 741529
line3:
ACH CREDIT RECEIVED - Cust ID: A415297 Desc: EBSETL0611 Comp Name: BLEHLLC Comp ID: 1234567898 SEC: CCD Cust Name: SAMJONESLANDRY 409 Addenda: No Addenda
capture only the A415297
I asked a similiar question not realizing that my data had different possibilities
Related Solutions:
Regular Expression needed to parse a string of multiple colons and extract an element
Answer : Regular Expression needed to parse a string of multiple colons and extract an element-revised
".*Cust ID:.*?\b([\w\d]+)\s*Desc.*
"
First group gives you the match.
It assumes that you need word just before Desc. If it's something else, please ask
Random Solutions
Windows 7 Logon Script - Permission Errors - Route Add etc
ASP app reference problem
SQL Server 2005 Casting behaviour
Check the smtp of every user in a OU and all below Ou's and get users who do not have both addesses.
Folder location for Logon scripts
How detect if the file being used by another process
HTC HD2 stopped syncing since moving to Exchange 2010
msaccess help with sql query
Windows Vista/7 Network Issues popping up..no connection to outside world
VBA creating a recordset with a query source