Unexpect Line Breaks in Flat File
Hello all, We have a clinical ER application that is used to review the necessity and validity of ER claims submitted. We need to export feeds from this application to go into another system, and for the most part the feeds work as expected. However, we have an issue at times with the pipe-delimited file having line breaks that throw off the file structure. The database serves a VB.net front end, where users are allowed to type free-text into a field. The users sometimes add multiple separate lines by using the enter key. When the flat file gets generated, those enter keys come out on the flat file. The data in the database shows no enter symbols or newline characters. I know we could redesign the VB.net front end to disallow the enter key, but that would take programming, testing, QAing, re-deploying, etc. We would like to strip out these enter symbols on the way out into the Flat File. I have tried searching for newline characters (char(10) or char(13)) and have found nothing. Does anyone know of any way we can strip out these newlines from the database? The notes column is VARCHAR. Thanks! Some example data: What the user enters: Code submitted does not support diagnosis. Deny PLG. Dr. John Jones How the field looks when queried: Code submitted does not support diagnosis. Deny PLG. Dr. John Jones An example of what we would see in the file: |00001|John|Doe|Approved. Medical necessity apparent. Dr. Smith|01/01/2012|02/01/2012| |00002|Jane|Doe|Code submitted does not support diagnosis. Deny PLG. Dr. John Jones|02/03/2012|02/10/2012| |00003|Abraham|Lincoln|Approved. Medical Necessity. Dr. Jane Smith|05/01/2012|06/01/2012|
November 11th, 2012 10:27am

|00002|Jane|Doe|Code submitted does not support diagnosis. Deny PLG. fragment means the CRLFs or LFs or CRs are in the file. Depends from what platform users submit them, so for example LF would not produce a linebreak in most apps in Windows OS The database client tool may not who what but it is there, I suggest you do strip those out before letting them into the DB To find the chars get a Hex editor, then look for 0D and 0A hex values in it Reference: http://mc-computing.com/Languages/CR_LF.htmArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
November 11th, 2012 10:38am

Adding to Arthur : chipmonk does the below help in any way ? System.Text.RegularExpressions.Regex.Replace( yourstring , "[\x00-\x1F]" , "") as this is quoted by Andrew Morton in the forms earlier @ http://social.msdn.microsoft.com/Forums/en-NZ/vbgeneral/thread/32519985-f8f1-4949-9a62-81d9c0353813 Thanks
November 11th, 2012 11:49am

Thank you for the suggestions, however, we are hoping to avoid validating the enter symbol in the VB.net app. I am looking for a way to identify the CRLFs in the database and ignore, or replace them.
Free Windows Admin Tool Kit Click here and download it now
November 11th, 2012 4:06pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics