Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 6th, 2003, 01:21 PM
Authorized User
 
Join Date: Oct 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Read certain line from a text file?

Hi all, I have a txt file stored on my server. I need to display the data from the file on the web browser. I understand there is functions like ".ReadLine", ".ReadAll", ".SkipLine" ... Now, in my text file, there are 3 lines. I need to display the first and third lines first, then display the second line. Eg:

In my text file:
==================
My name is Bob.
I have a pet.
I am 21 years old.

In web browser, it should display like this:
=============================================
My name is Bob.
I am 21 years old.
I have a pet.

How can I do that? I tried to use .SkipLine to skip the second line ("I have a pet") in text file, but end up error message saying it has reach end of file. HELP!!!

 
Old November 12th, 2003, 06:20 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

.

 
Old November 12th, 2003, 06:22 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why don't you try to write in your txt file lines in the right order?

 
Old November 12th, 2003, 07:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

You just need to separate the reading of the lines from the display. If you read each line into a separate variable first, then you can display the lines in any order you like.





Similar Threads
Thread Thread Starter Forum Replies Last Post
read text file senthilreddy ASP.NET 1.0 and 1.1 Basics 1 December 19th, 2010 10:56 PM
Read Text file and convert to Binary file VB.net sjlsysprg1 Pro VB.NET 2002/2003 4 June 29th, 2007 06:53 AM
How to read a line from a text file ? nobitavn94 C# 3 November 25th, 2006 11:04 PM
How to read file line by line in EVC++ iriskab Visual C++ 0 September 27th, 2006 01:39 PM
how can I insert a new line at top of text file? Satorikin VB.NET 1 March 4th, 2004 03:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.