How to know the format of a text file

  • Hi folks.... needed your suggestions.....

    I had created a text file named "forward.txt" in windows operating system. How can i know whether my text file "forward.txt" is a

    ASCII-CRLF

    ASCII-LF

    EBCDIC.

    I want to know my text file format. Is it in ASCII-CRLF format or in ASCII-LF format or in EBCDIC format??

    Thanks!!

  • There are some suggestions in Wikipedia on identifying the EOL character

    http://en.wikipedia.org/wiki/Newline

    hope this gives you a starting place.

    Ian

  • If you created it, you presumably know how you created it. If you created it on Wndows with Notepad, for example, it will use ASCII-CRLF (ANSI) unless you told the system to use a unicode format for it. If you created it with something that gives you full control over the output, it will be whatever format you generated. And so on.

    Tom

  • tinnusqlserver (5/5/2011)


    Hi folks.... needed your suggestions.....

    I had created a text file named "forward.txt" in windows operating system. How can i know whether my text file "forward.txt" is a

    ASCII-CRLF

    ASCII-LF

    EBCDIC.

    I want to know my text file format. Is it in ASCII-CRLF format or in ASCII-LF format or in EBCDIC format??

    Thanks!!

    There's really only one way to know for sure... open it up with a hex editor and look.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Jeff Moden (9/4/2011)


    There's really only one way to know for sure... open it up with a hex editor and look.

    Agreed. See also the Unicode Byte Order Mark FAQ for more details on Unicode and the characters which _may_ exist at the beginning indicating big-endian vs little-endian, but be aware that Microsoft uses UCS-2 instead of a modern (July 1996 or later) Unicode variant.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply