Search code examples
pythoncsvxlsx

How to create new sheets inside a CSV file


I have created a json to csv converter. Now I am required to create some sub-sheets in a sheet. I have a main spreadsheet called hello.csv and this hello.csv must contain more than 1 spread sheet( hi, sup, good). The json has multiple tables and I want to parse those tables to new spreadsheets but all should be in the same file ie. hello.csv. I know this can be done by the workbook class in the xlsx writer module but I have already written a lot of code in using csv module.

How do I create subsheets using the csv module?


Solution

  • There is no concept of sheet with respect to a CSV file.

    In other words: one CSV file has only one sheet.

    Ref. https://en.m.wikipedia.org/wiki/Comma-separated_values