Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting the GMT time Pin
Luc Pattyn9-Jan-09 2:19
sitebuilderLuc Pattyn9-Jan-09 2:19 
GeneralRe: Getting the GMT time Pin
tauras819-Jan-09 2:28
tauras819-Jan-09 2:28 
GeneralRe: Getting the GMT time Pin
Luc Pattyn9-Jan-09 2:35
sitebuilderLuc Pattyn9-Jan-09 2:35 
GeneralRe: Getting the GMT time Pin
User 66589-Jan-09 2:37
User 66589-Jan-09 2:37 
GeneralRe: Getting the GMT time Pin
Eddy Vluggen9-Jan-09 8:51
professionalEddy Vluggen9-Jan-09 8:51 
Question"Windows has triggered a breakpoint" error. Pin
Benny_Lava9-Jan-09 1:29
Benny_Lava9-Jan-09 1:29 
AnswerRe: "Windows has triggered a breakpoint" error. Pin
c0ax_lx9-Jan-09 3:55
c0ax_lx9-Jan-09 3:55 
QuestionReading Large Files Pin
MumbleB9-Jan-09 1:19
MumbleB9-Jan-09 1:19 
Hi Guys. I have now searched the Web and can't seem to find the exact solution for my problem. I am trying to process a file of just over 2gb in size. File contains 879 987 lines of data.

I am using the FileHelpers library to read the file, search for specific values and then writing other data from the file out to a new file.

MY problem is that It takes a few hours to read the file and I have to abort the job. Is there a better way of doing this? I have resorted to writing a splitter to split the file into smaller chunks and then processing the smaller 20+ files which is much faster but also takes a bit of time to do.

Can anybody please advise of a better or faster way of reading the one big file and doing what I am doing below??

string filePath;
filePath = txtBoxSelectFile.Text;


FileHelperEngine<IvalueRev> engine = new FileHelperEngine<IvalueRev>();

engine.ErrorManager.ErrorMode = ErrorMode.SaveAndContinue;

IvalueRev[] res = engine.ReadFile(filePath);

if (engine.ErrorManager.ErrorCount > 0)
    engine.ErrorManager.SaveErrors(@"C:\Errors.txt");
StreamWriter sw = new StreamWriter(filePath + ".txt");
foreach (IvalueRev rev in res)
{
    if (rev.Flag == "2" || rev.Flag == "4" || rev.Flag == "5" || rev.Flag == "6" || rev.Flag == "7" || rev.Flag == "8" || rev.Flag == "9")
    {
        sw.WriteLine(rev.HID.ToString() + "\t" + rev.Flag.ToString());
    }
}

sw.Close();


Excellence is doing ordinary things extraordinarily well.

GeneralRe: Reading Large Files Pin
Luc Pattyn9-Jan-09 2:27
sitebuilderLuc Pattyn9-Jan-09 2:27 
GeneralRe: Reading Large Files Pin
MumbleB9-Jan-09 2:40
MumbleB9-Jan-09 2:40 
GeneralRe: Reading Large Files Pin
Luc Pattyn9-Jan-09 3:09
sitebuilderLuc Pattyn9-Jan-09 3:09 
GeneralRe: Reading Large Files Pin
musefan9-Jan-09 3:11
musefan9-Jan-09 3:11 
GeneralRe: Reading Large Files Pin
Ben Fair9-Jan-09 5:56
Ben Fair9-Jan-09 5:56 
GeneralRe: Reading Large Files Pin
MumbleB10-Jan-09 23:56
MumbleB10-Jan-09 23:56 
GeneralRe: Reading Large Files Pin
Ben Fair11-Jan-09 11:08
Ben Fair11-Jan-09 11:08 
QuestionPopulating ComboBox from ArrayList Pin
kanchoette8-Jan-09 23:07
kanchoette8-Jan-09 23:07 
AnswerRe: Populating ComboBox from ArrayList Pin
kanchoette8-Jan-09 23:32
kanchoette8-Jan-09 23:32 
QuestionDateTimePicker Pin
sandhya148-Jan-09 22:51
sandhya148-Jan-09 22:51 
AnswerRe: DateTimePicker Pin
Kristian Sixhøj8-Jan-09 22:55
Kristian Sixhøj8-Jan-09 22:55 
GeneralRe: DateTimePicker Pin
sandhya149-Jan-09 0:31
sandhya149-Jan-09 0:31 
GeneralRe: DateTimePicker Pin
User 66589-Jan-09 1:05
User 66589-Jan-09 1:05 
AnswerRe: DateTimePicker Pin
J4amieC8-Jan-09 23:34
J4amieC8-Jan-09 23:34 
AnswerRe: DateTimePicker Pin
belzer9-Jan-09 4:53
belzer9-Jan-09 4:53 
QuestionAN OPERATION ON SOCKET CANNOT BE PERFORMED - ERROR MESSAGE !!! Pin
senthilnathan8-Jan-09 22:36
senthilnathan8-Jan-09 22:36 
AnswerRe: AN OPERATION ON SOCKET CANNOT BE PERFORMED - ERROR MESSAGE !!! Pin
Colin Angus Mackay8-Jan-09 23:01
Colin Angus Mackay8-Jan-09 23:01 

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.