Title: Message
Sometimes for "special cases" from inconsistent sources, I would run the file through DOSCVT first.  It will either add or strip 0D 0A combinations as you tell it.  If you are building something, it is probably not good to build it around a freeware dos program from 10 years ago - on the other hand if you want to get something done NOW it is a tool that is handy to have.
 
You can Google for DOSCVT.exe - I just looked at this one and it is the same as the one I have - actually dated 1993 - I don't think there will be an "2003" version out anytime soon.
 
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich McNeil
Sent: Sunday, July 10, 2005 2:03 PM
To: [email protected]
Subject: RE: [Talk] Trouble identifying the CR (carriage return) control character

You might try DataStation’s FileReplace command.  It’s pretty smart about handling inconsistent chr(10)’s.

 

 

Rich McNeil

Boston Software Systems

866 653 5105

www.bostonworkstation.com


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roger Tack
Sent: Sunday, July 10, 2005 2:37 PM
To: [email protected]
Subject: [Talk] Trouble identifying the CR (carriage return) control character

 

Would anyone have an answer as to why I can’t identify a CR (carriage return)

 

I get a file from an outside vendor and they are not consistent with adding the carriage return. I’m trying to make the script smart enough to identify if the CR is missing or not. Below is an example of the file In HEX:

 

 2020 2050 524C 4342 2048 4F53 5049 5441   Translates to       PRLCB HOSPITA

4C20 4348 4152 4745 2052 5054 2020 2020    Translates to   L CHARGE RPT

200A 0A0A 5041 5449 454E 5423 2E2E 2E2E Translates to    …PATIENT#0000

 

I’m trying to get the last line from above to look like the following:

 

200D 0A0D 0A0D 0A50 4154 4945 4E54 232E  Translates to  ……PATIENT#.

 

My code is as follows:

 

Line Input #1, Search_Line

 Search_Char = Chr(13)

Search_Results = InStr(1, Search_Line, Search_Char, 1)

If Search_Results = 0 Then

    Replacement_Data = Replace(Search_Line, Chr(10), Chr(13) & Chr(10))

Else

    GoTo OPEN_FILE_CONTINUE

End If

Close #1

Open CommonDialog.FileName For Output As 1

Print #1, Replacement_Data

Close #1

 

It will identity the line feed if I set the search_char to Chr(10), so I don’t know why it will not find the Chr(13). This routine will loop until the carriage return is found. Search_Results should contain the position if of the carriage return if found.

 

Any help will be appreciated.

 

Thanks.

 

 

 

Roger Tack

Sr. Programmer/Analyst

St. Joseph Regional Medical Center

208-799-5721

 


NOTE: This e-mail message may contain information that may be privileged, confidential, and exempt from disclosure. It is intended for use only by the person to whom it is addressed. If you have received this message in error, please do not forward or use this information in any way. Delete it immediately, and contact the sender as soon as possible by the reply option or by telephone at the telephone number listed (if available). Thank you.

Reply via email to