Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / April 2007

Tip: Looking for answers? Try searching our database.

DOS/UNIX/MAC files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CoRrRan - 23 Apr 2007 11:30 GMT
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. - 23 Apr 2007 12:45 GMT
> 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.
CoRrRan - 23 Apr 2007 13:48 GMT
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

>> 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
[quoted text clipped - 12 lines]
> HTH,
>    Phill  W.
Herfried K. Wagner [MVP] - 23 Apr 2007 21:56 GMT
"CoRrRan" <CoRrRan~NOSPAM~@~NOSPAM~gmail.com> schrieb:
> 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.

Signature

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

CoRrRan - 24 Apr 2007 14:41 GMT
Ah, so it does 'cheat'. :-) I guess I'll have to think of something similar.

Thanks for answering Herfried!

CoRrRan

> "CoRrRan" <CoRrRan~NOSPAM~@~NOSPAM~gmail.com> schrieb:
>> Yes, I do realize I can do that, but I KNOW I will encounter both UNIX
[quoted text clipped - 6 lines]
> Yes, the decision is made on some (statistical) analysis of a part of
> the file.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.