Read the complete articles:
Last active
March 30, 2023 17:11
-
-
Save aspose-com-gists/01d71bf3cafec445f7ea46625a5dbaa3 to your computer and use it in GitHub Desktop.
Convert CSV to Excel and Excel to CSV in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, LoadOptions, SaveFormat | |
# Create CSV LoadOptions object | |
loadOptions = LoadOptions(FileFormatType.CSV) | |
# Create a Workbook object with CSV file's path and the loadOptions | |
workbook = Workbook("data.csv", loadOptions) | |
# Save CSV as XLSX | |
workbook.save("CsvToExcel.xlsx" , SaveFormat.XLSX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, SaveFormat | |
# Create a Workbook object with Excel file's path | |
workbook = Workbook("data.xlsx") | |
# Save XLSX as CSV | |
workbook.save("ExcelToCSV.csv" , SaveFormat.CSV) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment