Note that there are some explanatory texts on larger screens.

plurals
  1. POC# streamreader, delimiter.
    primarykey
    data
    text
    <p>What I have is a txt file that is huge, 60MB. I need to read each line and produce a file, split based on a delimiter. I'm having no issue reading the file or producing the file, my complication comes from the delimiter, it can't see the delimiter. If anybody could offer a suggestion on how to read that delimiter I would be so grateful.</p> <p>delimiter = Ç</p> <pre><code>public void file1() { string betaFilePath = @"C:\dtable.txt"; StringBuilder sb = new StringBuilder(); using (FileStream fs = new FileStream(betaFilePath, FileMode.Open)) using (StreamReader rdr = new StreamReader(fs)) { while (!rdr.EndOfStream) { string[] betaFileLine = rdr.ReadLine().Split('Ç'); { sb.AppendLine(betaFileLine[0] + "ç" + betaFileLine[1] + betaFileLine[2] + "ç" + betaFileLine[3] + "ç" + betaFileLine[4] + "ç" + betaFileLine[5] + "ç" + betaFileLine[6] + "ç" + betaFileLine[7] + "ç" + betaFileLine[8] + "ç" + betaFileLine[9] + "ç" + betaFileLine[10] + "ç"); } } } using (FileStream fs = new FileStream(@"C:\testarea\load1.txt", FileMode.Create)) using (StreamWriter writer = new StreamWriter(fs)) { writer.Write(sb.ToString()); } } </code></pre> <p>Small update:</p> <pre><code>string[] betaFileLine = rdr.ReadLine().Split('Ç'); </code></pre> <p>It's not able to split on the charecter Ç. When i debug it, it comes out to be an unreadable charecter.</p> <p>Guys, thanks for the help you defiently pointed my in the right direction.</p> <p>Changing: </p> <pre><code>using (StreamReader rdr = new StreamReader(fs)) </code></pre> <p>To: </p> <pre><code>using (StreamReader rdr = new StreamReader((fs),Encoding.Default)) </code></pre> <p>Fixed it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload