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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read All Files in Directory???

Status
Not open for further replies.

hummer010

Technical User
Sep 29, 2000
12
0
0
CA
I have an .asp page that currently opens one text file, and creates a new one based on the old text file.

Currently I have a text box where the old file's name/path is entered.

I would like to be able to enter a directory path into the text box, and have the asp open each file in the directory, and create a new file for each one.

Here is my Code:

set fso = server.createobject("Scripting.FileSystemObject")
set readFile = fso_OpenTextFile(ReadFileName, 1)
set writeFile = fso.CreateTextFile(WriteFileName, True)

While NOT readFile.AtEndOfStream
RLine = readFile.readline

'Manipulate Rline into a bunch of variables

WLine = " " & LineName & ShotPoint & " " & Lat & Lon & " " & xLine & yLine

writeFile.writeline WLine
Wend

Currently the ReadFileName is taken from the querystring(passed from text box), and the WriteFileName is created based on the ReadFileName(The file extension is changed). I would like to get a directory path passed in the querystring, and then make ReadFileName equal to each file name in the directory sequentially. Is this possible in .asp??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top