Click here to Skip to main content
16,004,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: IDREES Pin
Colin Angus Mackay20-Apr-05 3:52
Colin Angus Mackay20-Apr-05 3:52 
GeneralRe: IDREES Pin
DavidNohejl20-Apr-05 4:41
DavidNohejl20-Apr-05 4:41 
GeneralRe: IDREES Pin
Colin Angus Mackay20-Apr-05 4:45
Colin Angus Mackay20-Apr-05 4:45 
GeneralRe: IDREES Pin
Anonymous21-Apr-05 4:09
Anonymous21-Apr-05 4:09 
GeneralRe: IDREES Pin
Colin Angus Mackay21-Apr-05 4:20
Colin Angus Mackay21-Apr-05 4:20 
GeneralProblem with .NET 2 Beta 2 (C# Express Beta 2) Pin
Jucs20-Apr-05 3:31
Jucs20-Apr-05 3:31 
GeneralRe: Problem with .NET 2 Beta 2 (C# Express Beta 2) Pin
Robert M. Bouwens20-Apr-05 5:14
Robert M. Bouwens20-Apr-05 5:14 
GeneralProblem with StreamReader.BaseStream.Position Pin
AfzalHassen20-Apr-05 3:27
AfzalHassen20-Apr-05 3:27 
Hi,

Heres an example of what i am doing now...

line 01 RECORD 1 ,RECORD 2 ,RECORD 3
line 02 data,data,data
line 03 data, ,data
line 04 data,data,data
line 05 RECORD 4 ,RECORD 5 ,RECORD 6
line 06 data,data,data
line 07 data,data,data
line 08 ,data,
line 09 data, ,data
line 10 RECORD 4 ,RECORD 5 ,RECORD 6
line 11 data,data,data
line 12 data, ,data
line 13 data,data,data

I am iterating through the file line by line, because the data between the blocks of records are inconsistent, i'm using regular expresion to test for the begining of the next record so that i know what data to process. the problem is that the method that is making use of this piece of code is required to return only 1 record at any one time. i have managed to solve the 1 record at a time issue by keeping track of the records that were returned and then following a few other steps.

Because I'm testing for the beginning of the next record, the StreamReader will alwaus pass the point at which I need to be in order to read the next block of records that I need to process. i.e line
I have tried moving the position of the base stream to less than to where/what it currently is by doing the following..

_myFile.BaseStream.Position = _myFile.BaseStream.Position - _previousLineData.Length;
but this doesn't work Frown | :(

In addition, both overloads of the Peek() method of the StreamReader are of no use to me (since they only peek for characters without advancing the StreamReader) and i need to read the whole line to test the RegEx in order to determine whether i have reached the end of a block of records.

as can be seen by the generic sample of the file data above, the data in the file is not well organised and or managed.

any help/hints and advice will be much appreciated..



Thanks a million
Afzal Hassen
QuestionHow to add flash into C# applications? Pin
Alper Camel20-Apr-05 3:20
Alper Camel20-Apr-05 3:20 
GeneralAutocomplete/intellisence in a multiline edit box Pin
djkno320-Apr-05 2:28
djkno320-Apr-05 2:28 
GeneralRe: Autocomplete/intellisence in a multiline edit box Pin
Ashok Dhamija20-Apr-05 17:41
Ashok Dhamija20-Apr-05 17:41 
GeneralRe: Autocomplete/intellisence in a multiline edit box Pin
djkno321-Apr-05 10:08
djkno321-Apr-05 10:08 
GeneralWindows Forms - Programmatically scroll a listview control to the selected item Pin
abcxyz8220-Apr-05 2:15
abcxyz8220-Apr-05 2:15 
GeneralRe: Windows Forms - Programmatically scroll a listview control to the selected item Pin
Dave Kreskowiak20-Apr-05 5:56
mveDave Kreskowiak20-Apr-05 5:56 
QuestionHow to extract the sql query from a report Pin
Ana-Gabriela Clem20-Apr-05 1:52
Ana-Gabriela Clem20-Apr-05 1:52 
Questionlocal method variable or global class ? Pin
CiNN20-Apr-05 1:25
CiNN20-Apr-05 1:25 
AnswerRe: local method variable or global class ? Pin
Enishi20-Apr-05 1:37
Enishi20-Apr-05 1:37 
GeneralRe: local method variable or global class ? Pin
CiNN20-Apr-05 2:02
CiNN20-Apr-05 2:02 
AnswerRe: local method variable or global class ? Pin
S. Senthil Kumar20-Apr-05 2:09
S. Senthil Kumar20-Apr-05 2:09 
GeneralRe: local method variable or global class ? Pin
Sebastian Schneider20-Apr-05 3:50
Sebastian Schneider20-Apr-05 3:50 
GeneralRe: local method variable or global class ? Pin
S. Senthil Kumar20-Apr-05 4:33
S. Senthil Kumar20-Apr-05 4:33 
GeneralRe: local method variable or global class ? Pin
Dave Kreskowiak20-Apr-05 5:52
mveDave Kreskowiak20-Apr-05 5:52 
GeneralRe: local method variable or global class ? Pin
S. Senthil Kumar20-Apr-05 6:04
S. Senthil Kumar20-Apr-05 6:04 
GeneralRe: local method variable or global class ? Pin
Dave Kreskowiak20-Apr-05 14:25
mveDave Kreskowiak20-Apr-05 14:25 
GeneralRe: local method variable or global class ? Pin
S. Senthil Kumar20-Apr-05 19:07
S. Senthil Kumar20-Apr-05 19:07 

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.