How to identify/handle text file newlines in Java?
        Posted  
        
            by rafrafUk
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by rafrafUk
        
        
        
        Published on 2010-06-11T11:45:47Z
        Indexed on 
            2010/06/11
            13:22 UTC
        
        
        Read the original article
        Hit count: 203
        
Hi Everyone!
I get files in different formats coming from different systems that I need to import into our database. Part of the import process it to check the line length to make sure the format is correct. We seem to be having issues with files coming from UNIX systems where one character is added. I suspect this is due to the return carriage being encoded differently on UNIX and windows platform.
Is there a way to detect on which file system a file was created, other than checking the last character on the line? Or maybe a way of reading the files as text and not binary which I suspect is the issue?
Thanks Guys !
© Stack Overflow or respective owner