Hi William ,
i am sending u the text file data and code to process the text data.
Note : All this processing is done in windows service and checked with all
the encodings (Default,UTF8,unicode). i really don't known where i am going
wrong.
------------------------------------------------------
V|173848|1|4001938833|14250316|dsfsdfs|sdfsdfsdfsd |1000174076|0|sdfsdfsdfsdf|6674544|2330310451|1426 0601|sdfsdf||TUR|3|1|||asdsd|1||4001938833|16-03-1425||||asdas|sdfsdf||sdfds|Umit|Muhriz||Cicekli|T UR|asdas|1982/11/22||1|asdasd|1|140946|2005/06/30|asdasd|2006/06/29|1|||233|Umit Muhriz Cicekli||||||
V|173848|1|4001938833|14250316|dsfsdfs|sdfsdfsdfsd |1000174076|0|sdfsdfsdfsdf|6674544|2330310451|1426 0601|sdfsdf||TUR|3|1|||asdsd|1||4001938833|16-03-1425||||asdas|sdfsdf||sdfds|Umit|Muhriz||Cicekli|T UR|asdas|1982/11/22||1|asdasd|1|140946|2005/06/30|asdasd|2006/06/29|1|||233|Umit Muhriz Cicekli||||||
V|173848|1|4001938833|14250316|dsfsdfs|sdfsdfsdfsd |1000174076|0|sdfsdfsdfsdf|6674544|2330310451|1426 0601|sdfsdf||TUR|3|1|||asdsd|1||4001938833|16-03-1425||||asdas|sdfsdf||sdfds|Umit|Muhriz||Cicekli|T UR|asdas|1982/11/22||1|asdasd|1|140946|2005/06/30|asdasd|2006/06/29|1|||233|Umit Muhriz Cicekli||||||
V|173848|1|4001938833|14250316|dsfsdfs|sdfsdfsdfsd |1000174076|0|sdfsdfsdfsdf|6674544|2330310451|1426 0601|sdfsdf||TUR|3|1|||asdsd|1||4001938833|16-03-1425||||asdas|sdfsdf||sdfds|Umit|Muhriz||Cicekli|T UR|asdas|1982/11/22||1|asdasd|1|140946|2005/06/30|asdasd|2006/06/29|1|||233|Umit Muhriz Cicekli||||||
V|173848|1|4001938833|14250316|dsfsdfs|sdfsdfsdfsd |1000174076|0|sdfsdfsdfsdf|6674544|2330310451|1426 0601|sdfsdf||TUR|3|1|||asdsd|1||4001938833|16-03-1425||||asdas|sdfsdf||sdfds|Umit|Muhriz||Cicekli|T UR|asdas|1982/11/22||1|asdasd|1|140946|2005/06/30|asdasd|2006/06/29|1|||233|Umit Muhriz Cicekli|||||||
-------------------------------------------------------
// Reading the text file using stream reader
//Open the file using stream reader
ObjStreamReader = new StreamReader(e.FullPath,System.Text.Encoding.UTF8) ;
char c = ' ';
while (ObjStreamReader.Peek() > 0)
{
// Reading the line char by char
c = (char) ObjStreamReader.Read();
if (c != '\n')
{
strLine += c;
}
else
{
// building the Xml by splitting the strLine and
sending to the queue.
}
//Going to next line
} // end of while loop
thanks
syed
"William Stacey [MVP]" wrote:
hmm. 1MB is not large, so don't think that is the issue. Could you post a
small but complete code sample that shows the error?
--
William Stacey [MVP]
"syed javid" <sy*******@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com... hi all,
I am getting an error when i process 1 MB txt file using StreamReader and
i
am reading char by char using streamReader.Read() method at some point it
is
throwing an exception System.ComponentModel.win32Exception:The handle is
invalid.
Any help for this problem or any kind of informaiton to process large
files
the file size can be 10 MB.
thanks in advance
Syed