Jim Lawrence
accessd at shaw.ca
Tue Oct 20 13:29:11 CDT 2009
STREAMING would be even faster... I switched some ADO code from CHUNK picture data retrieval to ADO to Stream, a number of years ago, on a project and the transfer rate was on an order of magnitude faster. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 20, 2009 10:55 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com