Problem writing character to text file

keb1965

Well-known member
Joined
Feb 9, 2009
Messages
103
Programming Experience
10+
I have a need to write a character to a text file. Currently I am writing the file using a streamwriter and I have tried everything I can imagine, but I cannot get a single character "°" to write to the file properly. If I put it as a bit of text it is converted to "°" and this causes additional problems when the data has to be re-evaluated with another program.

I tried writing it as a string initially, then I tried writing it as a character, but regardless, each time it turns out the same.

I'd appreciate any help

Thanks
 
I have already had to issue a break in the loop to process application events, otherwise the program appears to hang
If you're doing time consuming processing in UI thread that in effect hangs your app, the UI thread depends on being free to handle both internal events and interaction with the Windows message queue. Throw a BackgroundWorker onto your form and use it to do the work on a secondary thread. Usually that also result in increased processing performance. Using DoEvents is a poor choice and only stalls the processing, it is not meant as substitution for common multithreading which has been made so simple with VB.Net.
 
Well, as it turns out the files and amount of data was considerably larger than the initial sample files provided ... nearly twice as large in fact.

I took your suggestion of moving some things into another thread and reworked much of the code to produce a faster result, but in the end, the file processing was still incredibly slow, so in the end, I settled on doing concurrent IO operations and passing the data to worker threads to process and return.

In the end, it processes about 2500 records per second, so that puts the processing time just over an hour or so for the first batch of 10m records. Still not as fast as I would like, but considerably faster than the 4 hours I was looking at previously AND the impossibility of managing all this data conversion without using software.

Thanks for your help!
 
Back
Top