Computing.Net > Forums > Windows NT > NT Script - verifying ASCII files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

NT Script - verifying ASCII files

Reply to Message Icon

Name: Philip Indlekofer
Date: February 10, 2003 at 09:24:24 Pacific
OS: Windows NT 4.00.1381 (SP6
CPU/Ram: 1.7 GHz / 512 MB
Comment:

Hi,
Does anybody know a way in NT of verifying that a file's contents are ASCII or not? Before you suggest "type", this doesn't work because even if it is not ASCII, the value of ERRORLEVEL is still 0, so that does not help me. We have users who should send us ".csv" ASCII files but it seems they occasionally send files with a ".csv" extension which are actually ".xls".
Also, if you have to know of a way of checking in a script the size of the file (we want to check that the file is not 0 (zero) bytes), that would be apperciated.
Thanks in advance for your help.



Sponsored Link
Ads by Google

Response Number 1
Name: Maurice Reed
Date: February 12, 2003 at 03:15:52 Pacific
Reply:

Unfortunately the DOS FAT file system and subsequent filesystems such as FAT32 & NTFS do not have any way of detecting the content type of a file unlike UNIX & LINUX file systems which are capable of this.
If you know someone who can write programs in 'C' it would be possible to write a program that looks at the start of a file and look for certain data patterns which would sehow that the file was an Excel .xls file and return a different ERRORLEVEL as to whether the file is a .xls or not and at the same time the program could be set to determine the file's length. For any experienced 'C' programmer this should not be too complex a task.


0

Response Number 2
Name: Lionel Boxer
Date: March 25, 2003 at 16:18:37 Pacific
Reply:

Hey Philip Indlekofer. Email me about Kiel Maslen. He says hello.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows NT Forum Home


Sponsored links

Ads by Google


Results for: NT Script - verifying ASCII files

NT script www.computing.net/answers/windows-nt/nt-script/12061.html

NT SCripting www.computing.net/answers/windows-nt/nt-scripting/12641.html

WINDOWS NT VIRUS OR CORRUPT FILES www.computing.net/answers/windows-nt/windows-nt-virus-or-corrupt-files/18915.html