diff --git a/packages/nc-gui/utils/parsers/CSVTemplateAdapter.ts b/packages/nc-gui/utils/parsers/CSVTemplateAdapter.ts index 4729696dfd..f39c1c914b 100644 --- a/packages/nc-gui/utils/parsers/CSVTemplateAdapter.ts +++ b/packages/nc-gui/utils/parsers/CSVTemplateAdapter.ts @@ -42,10 +42,11 @@ export default class CSVTemplateAdapter { initTemplate(tableIdx: number, fileName: string, columnNames: string[]) { const columnNameRowExist = +columnNames.every((v: any) => v === null || typeof v === 'string') const columnNamePrefixRef: Record = { id: 0 } + const tn = fileName.replace(/[` ~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/g, '_').trim() this.project.tables.push({ - table_name: fileName, - ref_table_name: fileName, + table_name: tn, + ref_table_name: tn, columns: [], })