Click here to Skip to main content
15,905,614 members
Home / Discussions / C#
   

C#

 
AnswerRe: Localization and Combo Boxes Pin
Colin Angus Mackay9-Jan-09 7:49
Colin Angus Mackay9-Jan-09 7:49 
Questiontoolbox of buttons Pin
abu rakan9-Jan-09 3:58
abu rakan9-Jan-09 3:58 
AnswerRe: toolbox of buttons Pin
User 66589-Jan-09 4:42
User 66589-Jan-09 4:42 
QuestionCrystal reports, Dynamic parameter values not showing up , Static works fine Pin
c0ax_lx9-Jan-09 3:37
c0ax_lx9-Jan-09 3:37 
QuestionHelp Required in Schedular Class Design Pin
Aman Bhullar9-Jan-09 2:11
Aman Bhullar9-Jan-09 2:11 
AnswerRe: Help Required in Schedular Class Design Pin
J4amieC9-Jan-09 2:57
J4amieC9-Jan-09 2:57 
GeneralRe: Help Required in Schedular Class Design Pin
Luc Pattyn9-Jan-09 3:31
sitebuilderLuc Pattyn9-Jan-09 3:31 
AnswerRe: Help Required in Schedular Class Design Pin
Eddy Vluggen9-Jan-09 8:49
professionalEddy Vluggen9-Jan-09 8:49 
QuestionGetting the GMT time Pin
tauras819-Jan-09 2:08
tauras819-Jan-09 2:08 
AnswerRe: Getting the GMT time Pin
User 66589-Jan-09 2:15
User 66589-Jan-09 2:15 
GeneralRe: Getting the GMT time Pin
tauras819-Jan-09 2:18
tauras819-Jan-09 2:18 
GeneralRe: Getting the GMT time Pin
Luc Pattyn9-Jan-09 2:19
sitebuilderLuc Pattyn9-Jan-09 2:19 
GeneralRe: Getting the GMT time Pin
tauras819-Jan-09 2:28
tauras819-Jan-09 2:28 
GeneralRe: Getting the GMT time Pin
Luc Pattyn9-Jan-09 2:35
sitebuilderLuc Pattyn9-Jan-09 2:35 
GeneralRe: Getting the GMT time Pin
User 66589-Jan-09 2:37
User 66589-Jan-09 2:37 
GeneralRe: Getting the GMT time Pin
Eddy Vluggen9-Jan-09 8:51
professionalEddy Vluggen9-Jan-09 8:51 
Question"Windows has triggered a breakpoint" error. Pin
Benny_Lava9-Jan-09 1:29
Benny_Lava9-Jan-09 1:29 
AnswerRe: "Windows has triggered a breakpoint" error. Pin
c0ax_lx9-Jan-09 3:55
c0ax_lx9-Jan-09 3:55 
QuestionReading Large Files Pin
MumbleB9-Jan-09 1:19
MumbleB9-Jan-09 1:19 
GeneralRe: Reading Large Files Pin
Luc Pattyn9-Jan-09 2:27
sitebuilderLuc Pattyn9-Jan-09 2:27 
GeneralRe: Reading Large Files Pin
MumbleB9-Jan-09 2:40
MumbleB9-Jan-09 2:40 
GeneralRe: Reading Large Files Pin
Luc Pattyn9-Jan-09 3:09
sitebuilderLuc Pattyn9-Jan-09 3:09 
Hi,

the code shown is fine.

I do not know what your file looks like, nor what you mean exactly by "search the file for specific values at specified offsets".

You will get linear performance (twice as big takes twice as long, and no more) as long as you can solve your problem while reading the file sequentially without memorizing it all. So if you know in advance you need specific lines (say by line numbers), then sort the line numbers, read the file sequentially and check the current line number with the next one of interest.

If your offsets are byte offsets relative to the file's origin, then you could still loop while reading
lines as you did, and ask the stream for the current position, and act accordingly. This will work just
fine as long as you don't need to move backwards; again, you may need to sort the offsets first
(I am hoping you get all the offset values at the same time, otherwise you would not be able to sort them).

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Love, happiness and fewer bugs for 2009!


GeneralRe: Reading Large Files Pin
musefan9-Jan-09 3:11
musefan9-Jan-09 3:11 
GeneralRe: Reading Large Files Pin
Ben Fair9-Jan-09 5:56
Ben Fair9-Jan-09 5:56 
GeneralRe: Reading Large Files Pin
MumbleB10-Jan-09 23:56
MumbleB10-Jan-09 23:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.