Friday, 15 June 2012

c# - Convert Text file to Excel -


I have text files that I copy / paste in Excel to Excel, go to Data -> Columns Columns

  1. Then I select Delimate.
  2. Then select the Delimiter tab and semicolon.
  3. In the last step I have selected the text for all fields.

Now I want to automate it by creating a program in C #.

I will do some editing on the data in the Excel file. It can create a new Excel file if there is a specific column that has a specific name and so on. So, I can eliminate three or four excel files from a text file.

What are their relative qualities:

If you read the text file in a string / list then check the data, then write the data into different Excel files?

Or

Use a textTalk () method in C # and then after editing, write it in a new Excel file?

If someone is there, please suggest better ways to fulfill such things.

EDIT: I get lots of third party suggestions, but I want to do it myself so that I can learn. / P>

It's a great start to help you create Excel files programmatically Has been using for a very long time and has proved itself to work well.

You can try out the old version 3.1.3, if you face crashes / bugs, we had some problems with the current version, just as a tip.

Otherwise, if you do not want any library for any reason, you can always export to CSV. There should be no problem in implementing it.


No comments:

Post a Comment