473,508 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to read a file randomly

1 New Member
hi.......
i want a code which give me random excess to a file .......means let us say a file is there and i want to read data between 2 specific line and i have the line no. of both the line.............how could i do that ..................
thanks
Aug 23 '06 #1
1 1732
D_C
293 Contributor
Load each line of the file into an array/vector, depending on whether the number of lines is constant, and use indexes.
Aug 23 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2328
by: nephish | last post by:
Hey there. i want to set a variable to represent the last line of a text file how do i do that? or even better, how do i create a list of the lines of a text file?
3
3233
by: Jeremy | last post by:
I have a most aggravating problem. I don't understand what is causing readlines() not to read all the lines in the file. I have the following syntax: # some initial stuff XS =...
13
2299
by: Don Kim | last post by:
I'm writing a program to read 2,000,000 floating point numbers off a text file, to compute the sum, mean, and median. This is a direct example of Stroustrup's paper. But the program will not...
2
2674
by: CJ | last post by:
Newbie here. Trying to tackle following: Read text file containing list of files delimited by end of line chars. I need to somehow write a loop that filters out each of the lines of text...
1
3248
by: Benny Ng | last post by:
Hi,All, Export Method: ------------------------------------------------------------------------- strFileNameExport = "Results" Response.Clear() Response.Buffer = True...
3
1485
by: brian | last post by:
Hello, Can someone tell me how I can randomly assign a file to a variable from a directory. Example: Dim File as string I need to search through 'C:/Comics/' and have the program randomly...
7
1906
by: mavrick_101 | last post by:
Hi, I am trying to read a file through classic ASP. The file is located on a file server, seperate from the webserver. This is the path I'm trying to read the file from ...
24
6110
by: rudranee | last post by:
hi there, can anyone tell me how to lines from a file which are odd numbered i.e. 1st,3rd,5th...lines. i tried incrementing file pointer by 2 (fp=fp+2) but it does'nt work Can someone give me...
2
2482
by: TPK | last post by:
I have an HTML document with Javascript where I have a portion of the page contents, a series of questions, being pulled from a XML file. When the page dynamically builds all the questions and...
1
1525
by: irfath | last post by:
Write an interactive program that reads three (3) lists of numbers, which are stored in three separate files, and creates one (1) sorted list. Each file should contain not more than 15 numbers....
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.