Hello all, in a rush I posted this in the wrong place before...
I have a field [memo] which i need to extract multiple sets of data from. I am using mid$(instr()) find the strings but I am having a little trouble getting rid of unwanted data before or after the required string.
The data comes from an email generated from a web system. The length varies as does the number of lines in the body. here is an example:
Reason for rejection: Cancel Report
Other reason from user: This was redictated.
User Login: MDLoginName
User Name: MDName
User MD No.: MD#
User Was: Reporting/Dictating MD
Patient ID: 1234567
Patient MRN: 123456789
Patient Name: lastname, firstname
Result Header ID: 123456789
Dictation Date: 29-OCT-2004 16:13
Report Code: TR105
Report Title: PAIN MANAGEMENT LETTER
Result No: 123456789012
I can get the last string OK with
Which returns
123456789012
My problem is extracting lets say the...
Report code of TR105 and nothing after it. BTW the string after could vary in length from record to record.
I tried this bad code
Which returns
TR105
Report Title: PAIN MANAGEMENT LETTER
Result No: 123456789012
How do I get rid of ALL characters after TR105 without counting said characters after...TR105
Any input would be great. Thank in advance
Donald M
I have a field [memo] which i need to extract multiple sets of data from. I am using mid$(instr()) find the strings but I am having a little trouble getting rid of unwanted data before or after the required string.
The data comes from an email generated from a web system. The length varies as does the number of lines in the body. here is an example:
Reason for rejection: Cancel Report
Other reason from user: This was redictated.
User Login: MDLoginName
User Name: MDName
User MD No.: MD#
User Was: Reporting/Dictating MD
Patient ID: 1234567
Patient MRN: 123456789
Patient Name: lastname, firstname
Result Header ID: 123456789
Dictation Date: 29-OCT-2004 16:13
Report Code: TR105
Report Title: PAIN MANAGEMENT LETTER
Result No: 123456789012
I can get the last string OK with
Code:
Mid$(strmemo, InStr(strmemo, "result no: ") + 11)
123456789012
My problem is extracting lets say the...
Report code of TR105 and nothing after it. BTW the string after could vary in length from record to record.
I tried this bad code
Code:
Mid$(strmemo, InStr(strmemo, "report code: ") + 13)
TR105
Report Title: PAIN MANAGEMENT LETTER
Result No: 123456789012
How do I get rid of ALL characters after TR105 without counting said characters after...TR105
Any input would be great. Thank in advance
Donald M