473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to read a file using seek

Hi All,

I have 10 log files whose size is not fixed as they are being updated. I want to read these files and store it in 1 file.
the twist is i want to read say first 1024 bytes from each file and then after reading from all the files i want to read from the position till where i have read in the first file the next 1024 bytes and so on.

Please Let me know how this can be achieved.

Thanks & Regards
Aug 4 '10 #1
1 1823
Curtis Rutland
3,256 Expert 2GB
Open 10 FileStreams. Use .Read on them. You don't have to Seek, the FileStreams remember their place. Just use 1024 for the count.

But make sure to check if the FileStream is at the end of the file first.
Aug 4 '10 #2

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

Similar topics

2
by: Sabin Finateanu | last post by:
Hi I'm having problem reading a file from my program and I think it's from a procedure I'm using but I don't see where I'm going wrong. Here is the code: public bool AllowUsage() { ...
7
by: John Dann | last post by:
I'm tripping over a silly little problem when trying to read a text file, but can't see the fix. Outline code is: ---------------------------------------------------- FS=New FileStream(filename,...
2
by: fool | last post by:
Dear group, I am a beginner in php and I was little bit experience in C language. I want to read a file's content and delete the first line of the file and display those lines which has got...
5
by: Anja | last post by:
Hi everyone, I have a question about text file reading with VBA. I want to read he whole contents of the file in one string variable. I have been able to successfully read lines using: Line...
3
by: Archestic | last post by:
Hi, I have been given the task to make a file reading program which will: Take in a text file Read it and display its contents Do a quick word count Do a vowel count Im kind of new to java...
1
by: shaahid786 | last post by:
hallo, Plz tell me how can i read an Excell File using php code. its very urgent if sombody is on line plz tell me fast.coz i have to work on that. i have already search on diffrent sites...
1
by: gowda gopala | last post by:
plz anybody help me about file reading, i want to read file only selected part of it. whether it is possible are not?.
3
by: maw | last post by:
Hi, could somebody point me in the right direction for adding, removing and modifying nodes in an xml file programatically using vb.net (.net framework 2.0)? I have an xml file in the following...
4
by: nzjohnc | last post by:
Hi all, just started c ,need some help for storing values in arrays.I have opened the file for reading using fscanf,cos its got only three fields,but when i try to get the values to array,I'm...
2
by: Samudaya | last post by:
Hi, I have a application which has a xml file reading and wrting. I want to remove some element in xml file by using php. <?xml version="1.0" encoding="UTF-8"?> <element1>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.