DOS/UNIX/MAC files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CoRrRan

    #1

    DOS/UNIX/MAC files

    I would like to know how I can check, prior to opening a textfile, for
    DOS/UNIX/MAC formatting of the file. Is there a way to do this, or is it
    impossible?

    Thx, CoRrRan
  • Phill W.

    #2
    Re: DOS/UNIX/MAC files

    CoRrRan wrote:
    I would like to know how I can check, prior to opening a textfile, for
    DOS/UNIX/MAC formatting of the file. Is there a way to do this, or is it
    impossible?
    The best you can do is to take an "educated guess" based on the
    line-breaks that you find in the file ...

    Cr Mac (I think)
    Lf Unix
    Cr Lf Windows

    .... but it /is/ only a guess. There's /no/ guarantee that you won't
    find, say, Lf-delimited files on a Windows machine.

    HTH,
    Phill W.

    Comment

    • CoRrRan

      #3
      Re: DOS/UNIX/MAC files

      Hey Phill,

      Yes, I do realize I can do that, but I KNOW I will encounter both UNIX
      and DOS formatted text files. I know UltraEdit somehow knows what kind
      of file I'm trying to load, and consequently asks me to convert it. I
      guess it somehow is able to check for file formatting, but perhaps it
      does it in a rough way and reads in part of the file prior to asking me
      the conversion question. I was just hoping that somehow it is known on
      the outside what kind of file I'm trying to load.

      CoRrRan

      Phill W. wrote:
      CoRrRan wrote:
      >
      >I would like to know how I can check, prior to opening a textfile, for
      >DOS/UNIX/MAC formatting of the file. Is there a way to do this, or is
      >it impossible?
      >
      The best you can do is to take an "educated guess" based on the
      line-breaks that you find in the file ...
      >
      Cr Mac (I think)
      Lf Unix
      Cr Lf Windows
      >
      ... but it /is/ only a guess. There's /no/ guarantee that you won't
      find, say, Lf-delimited files on a Windows machine.
      >
      HTH,
      Phill W.

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: DOS/UNIX/MAC files

        "CoRrRan" <CoRrRan~NOSPAM ~@~NOSPAM~gmail .comschrieb:
        Yes, I do realize I can do that, but I KNOW I will encounter both UNIX and
        DOS formatted text files. I know UltraEdit somehow knows what kind of file
        I'm trying to load, and consequently asks me to convert it. I guess it
        somehow is able to check for file formatting, but perhaps it does it in a
        rough way and reads in part of the file prior to asking me the conversion
        question.
        Yes, the decision is made on some (statistical) analysis of a part of the
        file.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        • CoRrRan

          #5
          Re: DOS/UNIX/MAC files

          Ah, so it does 'cheat'. :-) I guess I'll have to think of something similar.

          Thanks for answering Herfried!

          CoRrRan

          Herfried K. Wagner [MVP] wrote:
          "CoRrRan" <CoRrRan~NOSPAM ~@~NOSPAM~gmail .comschrieb:
          >Yes, I do realize I can do that, but I KNOW I will encounter both UNIX
          >and DOS formatted text files. I know UltraEdit somehow knows what kind
          >of file I'm trying to load, and consequently asks me to convert it. I
          >guess it somehow is able to check for file formatting, but perhaps it
          >does it in a rough way and reads in part of the file prior to asking
          >me the conversion question.
          >
          Yes, the decision is made on some (statistical) analysis of a part of
          the file.
          >

          Comment

          Working...