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
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.
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.
Summary: I need to develop and test a export script. This script need to export and compress the dump file on disk. It also need to retain at least three to four days of the dump file. I am not much of NT exp...
Summary: I'm relatively new to NT scripting and I'm trying to write a batch file that can be scheduled using the at command to run on a nightly basis. Within the .BAT file I'd like to store the current system...
Summary: Recently a profile folder on my system became corrupt (or infected). The files in the folder contain ASCII and illegal characters as extensions and as filenames and extremely large files sizes, ie 2 ...