DOS/UNIX/MAC files

  • Thread starter Thread starter CoRrRan
  • Start date Start date
C

CoRrRan

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
 
CoRrRan said:
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.
 
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
 
CoRrRan said:
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.
 
Ah, so it does 'cheat'. :-) I guess I'll have to think of something similar.

Thanks for answering Herfried!

CoRrRan
 
Back
Top