Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: using text file


Message #1 by "Matthew Lohr " <mlohr@t...> on Mon, 28 May 2001 10:30:01 -0400
Can I use a text file to read info from.  I have a text file with email 

addresses.  I want to be able to select one email address at a time send 

the email and then go to the next address.  I know how to do it all with a 

database.  The addresses are on seperate lines.

Message #2 by "Charles Feduke" <webmaster@r...> on Tue, 29 May 2001 08:23:21 -0400
	Yes, you can use the FileSystemObject to read a file line by line.  It goes

something like this:



Dim fso, filInput, sEmail

Set fso = Server.CreateObject("FileSystemObject")

Set filInput = fso.OpenTextFile(Server.MapPath & "\yourFile.txt")

' cycle the file

Do While Not filInput.AtEndOfStream

	sEmail = filInput.ReadLine

	' do whatever you have to do with the e-mail address

Loop

' clean up

filInput.Close

Set filInput = Nothing

Set fso = Nothing



	HTH.



- Chuck



> -----Original Message-----

> From: Matthew Lohr [mailto:mlohr@t...]

> Sent: Monday, May 28, 2001 10:30 AM

> To: ASP Databases

> Subject: [asp_databases] using text file

>

>

> Can I use a text file to read info from.  I have a text file with email

> addresses.  I want to be able to select one email address at a time send

> the email and then go to the next address.  I know how to do it

> all with a

> database.  The addresses are on seperate lines.

Message #3 by "Matthew Lohr " <mlohr@t...> on Tue, 29 May 2001 09:33:08 -0400
Perfect. Thanks.  My list server sucks so I am going to use it for subscrib

e/unsubscribe and use asp to send out all the emails.  It stores the addres

ses in a text file.



---------- Original Message ----------------------------------

From: "Charles Feduke" <webmaster@r...>

Reply-To: "ASP Databases" <asp_databases@p...>

Date: Tue, 29 May 2001 08:23:21 -0400



>	Yes, you can use the FileSystemObject to read a file line by line.  It go

es

>something like this:

>

>Dim fso, filInput, sEmail

>Set fso =3D Server.CreateObject("FileSystemObject")

>Set filInput =3D fso.OpenTextFile(Server.MapPath & "\yourFile.txt")

>' cycle the file

>Do While Not filInput.AtEndOfStream

>	sEmail =3D filInput.ReadLine

>	' do whatever you have to do with the e-mail address

>Loop

>' clean up

>filInput.Close

>Set filInput =3D Nothing

>Set fso =3D Nothing

>

>	HTH.

>

>- Chuck

>

>> -----Original Message-----

>> From: Matthew Lohr [mailto:mlohr@t...]

>> Sent: Monday, May 28, 2001 10:30 AM

>> To: ASP Databases

>> Subject: [asp_databases] using text file

>>

>>

>> Can I use a text file to read info from.  I have a text file with email

>> addresses.  I want to be able to select one email address at a time send



>> the email and then go to the next address.  I know how to do it

>> all with a

>> database.  The addresses are on seperate lines.

>

>




  Return to Index