简体   繁体   中英

C# - Avoid reading csv file everytime

My input file have 7 million rows. It is taking long time to read the file. After that I have to modify the data based on clients requirement. If client add a new requirement then I have to read the csv file again. Is there any way to read and store csv file in some format in c#. So I can avoid reading csv file everytime. I cannot use SQL ,SQLITE or any other database to store the data.

Your choices are:

  1. Use another form of database - eg SQL, Mongo DB, Raven DB, Lucene
  2. Store the file in memory, and only save the changes at a certain time
  3. Break the file into smaller files, eg ID's 0-100000, 100001-200000, etc
  4. Maintain another file of the 'changes' and recombine them as needed (this is probably a bad idea)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM