'Material-table Exporting table rows as CSV excel files fails due to special symbol "#"

I have a material-table implemented in my react application which displays a list of products. The table has many rows of products and when i try to use the export feature which comes up with this library everything works fine and all products are exported in a CSV file. The only issue is when a special symbol especially # is present in any field of the row-column is present then the table is exported but only till the row which has that special symbol.

The Product page which has the Table implemented:

     <Table
          companyActiveAction={(e, data) => this.productStatusToggle(e, data)}
          tableReload={(e) => this.tableReload(e)}
          options={{
            exportButton: true,
          }}
          columns={columns}
          createNew={false}
          data={(query) => this.getTable(query)}
          title={'Products'}
          search={true}
          // exports={true}
          exports={this.props.UserDetail.permissions.exportRecord}
          paging={true}
          toDateFilter={(e) => this.toDateFilter(e)}
          fromDateFilter={(e) => this.fromDateFilter(e)}
          // datefilter={true}
        />


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source