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

C#

 
GeneralRe: algorthim Pin
Pete O'Hanlon8-Jan-08 4:06
mvePete O'Hanlon8-Jan-08 4:06 
GeneralRe: algorthim Pin
PIEBALDconsult8-Jan-08 10:06
mvePIEBALDconsult8-Jan-08 10:06 
GeneralRe: algorthim Pin
PIEBALDconsult8-Jan-08 10:10
mvePIEBALDconsult8-Jan-08 10:10 
GeneralCalling Stored Procedure for RDLC Report in C# Pin
salman_syed_018-Jan-08 2:19
salman_syed_018-Jan-08 2:19 
GeneralRe: Calling Stored Procedure for RDLC Report in C# Pin
Justin Perez8-Jan-08 3:54
Justin Perez8-Jan-08 3:54 
Generaldatagridview Pin
SVb.net8-Jan-08 2:17
SVb.net8-Jan-08 2:17 
GeneralRe: datagridview Pin
Justin Perez8-Jan-08 4:00
Justin Perez8-Jan-08 4:00 
QuestionHow to handle special International characters in C#. Pin
MinhajuddinK8-Jan-08 1:39
MinhajuddinK8-Jan-08 1:39 
Hi all,

I have written a small piece of code which splits a text file into "N" number of output files with "X" records each. The code is working fine, But it is unable to handle special characters. When the input file has text like --> "INDUSTRIESTRAßE" It's converting it to
--> "INDUSTRIESTRA?E". I have not included any provision to handle the special characters. How can I change the code so that it doesn't misinterpret these special characters while splitting a file.

This is the code which reads and writes the data.

<pre>

using (StreamReader sr = new StreamReader(input_file_path + "\\" + input_file_name))
{
if (firstLineColumns)
header = sr.ReadLine();
//Ignore the first line if the first line is columns
while (!sr.EndOfStream)
{
fs = new FileStream(target_path + "\\" + target_file_pattern + file_no.ToString() + extension, FileMode.Create);
sw = new StreamWriter(fs);
if (targetFirstLineColumns)
sw.WriteLine(header);
for (int i = 0; i &lt; number_of_lines_per_file &amp;&amp; !sr.EndOfStream; i++)
{
sw.WriteLine(sr.ReadLine());
}
sw.Close();
fs.Close();
file_no++;
}
}
</pre>

Here I want to split the input to "N" number of files with the "X" number of lines each.

Please help me out here.
Thank you very much!


You don't have to be AFRAID!
AnswerRe: How to handle special International characters in C#. Pin
Matthew Butler8-Jan-08 4:00
Matthew Butler8-Jan-08 4:00 
GeneralRe: How to handle special International characters in C#. Pin
MinhajuddinK8-Jan-08 5:34
MinhajuddinK8-Jan-08 5:34 
QuestioniTunes SDK (Cover Art) Pin
MicealG8-Jan-08 1:30
MicealG8-Jan-08 1:30 
Generalstruggling with return type of procedure Pin
tasumisra8-Jan-08 0:53
tasumisra8-Jan-08 0:53 
GeneralRe: struggling with return type of procedure Pin
Mircea Puiu8-Jan-08 1:12
Mircea Puiu8-Jan-08 1:12 
GeneralRe: struggling with return type of procedure Pin
tasumisra8-Jan-08 1:17
tasumisra8-Jan-08 1:17 
GeneralRe: struggling with return type of procedure Pin
Mircea Puiu8-Jan-08 1:24
Mircea Puiu8-Jan-08 1:24 
AnswerRe: struggling with return type of procedure Pin
Guffa8-Jan-08 3:38
Guffa8-Jan-08 3:38 
Generalassembly not found Pin
infi_20078-Jan-08 0:50
infi_20078-Jan-08 0:50 
GeneralRe: assembly not found Pin
Mircea Puiu8-Jan-08 1:07
Mircea Puiu8-Jan-08 1:07 
GeneralWindows Permission Dialog Pin
borjolujo8-Jan-08 0:29
borjolujo8-Jan-08 0:29 
QuestionCrystal Reports CrossTab fields Pin
adi.rusu8-Jan-08 0:03
adi.rusu8-Jan-08 0:03 
QuestionHow to call notepad from windows service Pin
ravindradonkada7-Jan-08 23:56
ravindradonkada7-Jan-08 23:56 
GeneralRe: How to call notepad from windows service Pin
sindhutiwari8-Jan-08 1:17
sindhutiwari8-Jan-08 1:17 
GeneralRe: How to call notepad from windows service Pin
Vasudevan Deepak Kumar8-Jan-08 2:31
Vasudevan Deepak Kumar8-Jan-08 2:31 
QuestionHow to open notepad from windows service Pin
ravindradonkada7-Jan-08 23:55
ravindradonkada7-Jan-08 23:55 
GeneralStarting NotePad from C# code Pin
Mircea Puiu8-Jan-08 0:57
Mircea Puiu8-Jan-08 0:57 

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.