Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Read and Search csv file using C (http://www.go4expert.com/forums/read-search-csv-file-using-c-t29675/)

electroon 25May2013 10:57

Read and Search csv file using C
HI All,

I was hoping someone could assist with the following coding;

I am trying to search a very large csv file (approx 200,000 lines) for a array of strings and get the output as the line where there text is found.
E.g. CSV file:
Now if I search for 123
my output array should give me

Could anyone please help with the coding for this, I need a pure C code for this? I am concerned with the very large csv I am using which will prob slow everything down.

Would appreciate any help on this,

Kind Regards,

xpi0t0s 26May2013 13:46

Re: Read and Search csv file using C
How far have you got and where are you stuck?
Do you understand the project requirements?
How large in bytes is your CSV file?

Are you really searching for an array of strings, or just the first column value?

I wouldn't worry too much about the size. Computers are very good at searching large files very quickly. Just do a line by line search and see how long it takes first time through; if this is a repeated task that needs to complete in a specific amount of time, and that amount of time is less than the time available, then you may need to think about how to optimise the search, but not before. Premature optimisation is a root of all kinds of evil.

All times are GMT +5.5. The time now is 07:20.