Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verifying if a ascii file

Status
Not open for further replies.

Kori

Programmer
Oct 17, 2000
35
US
I am trying to find a procedure or function in Visual Basic that will go and look at a file and tell me if it is a valid Ascii file. Can anyone help????
 
What is your definition of " ... a valid Ascii file ... "?

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
I mean a valid ascii file by saying it is not a binary file.
 
Hmmmmmmmmmmmmm,

Interesting ... v e r y I N T E R E S T I N G!

I know of NO function to seperate files by such a distinction. It "could" - with some real definition of what you mean by an ASCII file be done fairly trivially.

I would Propose{/b] such a definition:

All bytes within the file be:
Between Chr(32) And Chr(94) OR
Between Chr(97) And Chr(126) OR
Equal Chr(10) OR
Equal Chr(12) OR
Equal Chr(13)

IF this definition - or some 'reasonable' (e.g. logically consistient) alternative is acceptable, I'm sure a 'quick and dirty soloution' can be generated. BUT, you will almost certainly be waiting for such a routine to verify a "Large" file fits such a definition (but probably not very long to find that it does NOT fit the definition).

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top