Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
GeneralRe: how can i save utf-8 format characters to database Pin
Guffa15-Sep-06 1:45
Guffa15-Sep-06 1:45 
AnswerRe: how can i save utf-8 format characters to database Pin
morteza5715-Sep-06 23:26
morteza5715-Sep-06 23:26 
GeneralRe: how can i save utf-8 format characters to database Pin
sikandarhayat17-Sep-06 19:46
sikandarhayat17-Sep-06 19:46 
QuestionSplitting one large CSV file into smaller ones Pin
bigove15-Sep-06 0:49
bigove15-Sep-06 0:49 
AnswerRe: Splitting one large CSV file into smaller ones Pin
bigove15-Sep-06 1:12
bigove15-Sep-06 1:12 
AnswerRe: Splitting one large CSV file into smaller ones Pin
benjymous15-Sep-06 1:20
benjymous15-Sep-06 1:20 
GeneralRe: Splitting one large CSV file into smaller ones Pin
Sebastian Schneider15-Sep-06 3:38
Sebastian Schneider15-Sep-06 3:38 
GeneralRe: Splitting one large CSV file into smaller ones Pin
bigove15-Sep-06 4:09
bigove15-Sep-06 4:09 
Thanks for your help benjymous.

I have tried working through this, but no success yet; I know it is a basic thing I am missing, but not sure what. The code I have so far is:

using System;
using System.Collections;
using System.IO;
using System.Text;

public class CSVReader
{
// Open the files to write to
string fileName = @"C:\data\Test Data\Test\CIS_KASN.txt";
string textLine;
int row = 1;
}

public CSVReader(string fileName)
{
StreamReader fileReader = File.OpenText(fileName);
StreamWriter fileWriter1 = File.CreateText(@"C:data\Test Data\Test\Output1 CIS_KASN.txt");
StreamWriter fileWriter2 = File.CreateText(@"C:data\Test Data\Test\Output2 CIS_KASN.txt");

while ((textLine = fileReader.ReadLine()) != null && row <= 1000)
{
// Write to output file
fileWriter1.WriteLine(textLine);
row++;
}

fileWriter1.Close();

while ((textLine = fileReader.ReadLine()) != null & row > 1000)
{
// Write to output file
fileWriter2.WriteLine(textLine);
}

fileWriter2.Close();
}


Does this make much sense?

Also, point taken about the header; I'll work that part out when I get the main part working!

Thanks all.
AnswerRe: Splitting one large CSV file into smaller ones Pin
Andrew Rissing15-Sep-06 5:01
Andrew Rissing15-Sep-06 5:01 
GeneralRe: Splitting one large CSV file into smaller ones Pin
bigove15-Sep-06 5:11
bigove15-Sep-06 5:11 
Questionhow can i save uft-8 format characters to database Pin
sikandarhayat15-Sep-06 0:01
sikandarhayat15-Sep-06 0:01 
AnswerRe: how can i save uft-8 format characters to database Pin
Christian Graus15-Sep-06 0:24
protectorChristian Graus15-Sep-06 0:24 
GeneralRe: how can i save uft-8 format characters to database Pin
sikandarhayat15-Sep-06 0:40
sikandarhayat15-Sep-06 0:40 
AnswerRe: how can i save uft-8 format characters to database Pin
Guffa15-Sep-06 1:46
Guffa15-Sep-06 1:46 
QuestionVS2005 Reportviewer Print problem fix Pin
Glen Harvy14-Sep-06 23:50
Glen Harvy14-Sep-06 23:50 
Questionhow to update database after delete [modified] Pin
faladrim14-Sep-06 23:50
faladrim14-Sep-06 23:50 
AnswerRe: how to get the index of a selected row Pin
mikone15-Sep-06 0:06
mikone15-Sep-06 0:06 
AnswerRe: how to get the index of a selected row Pin
wheelerbarry15-Sep-06 0:06
wheelerbarry15-Sep-06 0:06 
AnswerRe: how to update database after delete Pin
mikone15-Sep-06 1:06
mikone15-Sep-06 1:06 
GeneralRe: how to get the index of a selected row Pin
faladrim15-Sep-06 0:31
faladrim15-Sep-06 0:31 
GeneralRe: how to update database after delete Pin
faladrim15-Sep-06 1:33
faladrim15-Sep-06 1:33 
QuestionRe: how to get the index of a selected row Pin
wheelerbarry15-Sep-06 1:03
wheelerbarry15-Sep-06 1:03 
GeneralRe: how to update database after delete Pin
mikone15-Sep-06 1:44
mikone15-Sep-06 1:44 
AnswerRe: how to get the index of a selected row Pin
faladrim15-Sep-06 1:08
faladrim15-Sep-06 1:08 
GeneralRe: how to update database after delete Pin
faladrim15-Sep-06 1:55
faladrim15-Sep-06 1:55 

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.