0

I combine different .xls/.xlsx/.csv files into one tab delimited text file and these files have different / common columns. These files can be huge and a lot in number. So i make a test scenario and take 15 of these input files which make up a Text Delimited file of approx 6 gb. And i want to save this file as .xlsx sheet.

So i load the text file using a class i googled online TextToDataSet . It worked nicely with small files but now with 6gb file it crashes instantly which reading it.

And if some how i succeed in reading the text file i use EPPlus to export DataTable to Excel.

How to solve this issue, Am i doing it all wrong . What is a better approach?

Reg Edit
  • 6,719
  • 1
  • 35
  • 46
confusedMind
  • 2,573
  • 7
  • 33
  • 74

1 Answers1

0

Excel will read delimited files. As you have a delimited file, and you want to save it as an xlsx, you can open it with Excel and then use Save As to create the xlsx file.

Reg Edit
  • 6,719
  • 1
  • 35
  • 46
  • Yes i thought of that as worst case scenario, but i do the above in code so at the end i want to read the txt file and save it to excel in code... – confusedMind Aug 22 '14 at 19:38
  • No problem--just use [.Net Excel interop](http://stackoverflow.com/questions/14248592/running-an-excel-macro-via-c-run-a-macro-from-one-workbook-on-another) to do it from any C# app. – Reg Edit Aug 22 '14 at 19:50
  • Just opened the file manually in excel using (text import function) and too approx 2-3 minutes. So i hope it wont crash while doing the above..(Excel Interop Solution) – confusedMind Aug 22 '14 at 19:54
  • That seems like an awful lot of data to stash in an excel spreadsheet.....it honestly sounds like you might be better off targeting a full on SQL database, as this seems like too much for even MS access to properly deal with...... – user2366842 Aug 22 '14 at 21:56
  • @user2366842 .. I totally agree but the client has all these files he need to merge them together maybe he will run some Vba code on it etc.. – confusedMind Aug 23 '14 at 15:03