how to convert csv format file into xlsx
Admin note: Please use always the appropriate category when posting a topic (this shouldn’t be in the “Uncategorized” section), along with an appropriate title.
You can read the contents of the .CSV file using one of the .ReadCSV actions.
The output of these actions is a data table. Look here:
After that you can write the extracted data table to an excel instance.
You can do that by creating a loop that iterates the data table, one position at a time and writes the data to a specified position (I am thinking of a 1-1 approach) to the excel instance using the Excel.WriteCell action. Look here:
If you have a CSV file already and you don’t need to write it into an existing Excel worksheet, but rather a new one, maybe this’ll make your life easier.
file.ReadCSV \ CSVFile: "C:\Users\you\Documents\Robin\9.2\forum\csvtest.csv" \ Encoding:File.CSVEncoding.UTF8 \ TrimFields:True \ FirstLineContainsColumnNames:False \ ColumnsSeparator:File.CSVColumnsSeparator.SystemDefault \ CSVTable=> CSVTable Excel.Launch \ Visible:True \ LoadAddInsAndMacros:False \ Instance=> ExcelInstance Excel.Write \ Instance: ExcelInstance \ Value: CSVTable
John,Doe,Hospitality,Janitor,Level one Veejay,Singh,HR,Manager,Level five Herbert,Meuller,Engineering,Tech,Level three