Click to See Complete Forum and Search --> : Check the length of a textfile


Jontron
07-17-2007, 01:05 PM
Does anyone know of a good way to check the length of a text file in ASP? I mean number of lines. :)

Also, what kind of command would I use to check a specific character in a text file line... for instance line 3 character 8. Then have that character become its own separate variable that I can use.

Jontron
07-17-2007, 03:28 PM
Sorry, I think I may have been unclear, I'm creating a text file that hold some numbers. Its going to look like this:


193811 9
323983 1
243984 6
343478 7
242872 5


there is a few things I need to know.

How can I determine what the first 6 numbers of line X are.

How can I determine what number lies in the 8th column.

Honeslty, I would much rather use an excel sheet but am clueless as to how to do this.

nbcrockett
07-17-2007, 03:47 PM
Try this site's samples on Access databases, Excel files, and text files. I personnal prefer Access. Post back if you have questions.
http://www.asp101.com/samples/

buntine
07-17-2007, 09:23 PM
You could open the file and count the newline characters (they are hidden in text editors).

I also believe VBScript file-handling functions will allow you to jump to a specific line. From there you could use the "Left" function to grab the first six characters.

See the link posted above!

Cheers.