Current location: Hot Scripts Forums » Programming Languages » ASP » reading text from a file


reading text from a file

Reply
  #1 (permalink)  
Old 11-08-04, 09:00 AM
waji waji is offline
Newbie Coder
 
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
reading text from a file

Hello all

i m new to asp, and want a script which read text from a txt file or doc file and show it on asp page.
Suppose, i have a file something.txt or something.doc and it have some text so i want that the text of these file display in asp page.

thank you very much

hoping to get good resaults,

thankx all
__________________
itsmardan.com
Reply With Quote
  #2 (permalink)  
Old 11-08-04, 11:08 AM
koncept
Guest
 
Posts: n/a
peice of cake. i would reccomend keeping the extensions to .txt

Code:
<% response.Write CreateObject("Scripting.FileSystemObject").OpenTextFile _
		(Server.MapPath("\name.txt"), 1, False, False).readall%>
then just change the \name.txt to be the correct path & file name. you can make it change via a querystring if you wanted to have many text files but only one page to view all of them
Reply With Quote
  #3 (permalink)  
Old 11-09-04, 11:41 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Here is a pretty good tutorial. Teaches you how to use FSO so you can read text from files and stuff, http://www.stardeveloper.com/article...1050301&page=1

Quote:
Originally Posted by waji
Hello all

i m new to asp, and want a script which read text from a txt file or doc file and show it on asp page.
Suppose, i have a file something.txt or something.doc and it have some text so i want that the text of these file display in asp page.

thank you very much

hoping to get good resaults,

thankx all
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text file reading - IO namespace or OpenFile()? timotero Visual Basic 2 09-30-04 10:15 AM
Excel document containing records, need to save as a text file to upload to mysql bearslife PHP 1 06-05-04 03:24 AM
reading numbers from a text file ASHRAF C/C++ 1 02-16-04 04:31 PM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 07:19 PM
Editing a text file. cjh_60 PHP 1 10-14-03 03:59 PM


All times are GMT -5. The time now is 03:10 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.