Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 47782e9

Browse files
committed
improving import csv
1 parent 881b662 commit 47782e9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/stateManagement/data/handlers/SaveDataFromFileHandlerAction.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ export default class SaveDataFromFileHandlerAction extends AbstractTableAction<D
6060
const potentialPath = currentline[fileIndex];
6161
currentline.splice(fileIndex, 1);
6262
// Obtain just the filename from the path
63-
let filename = potentialPath?.split("/").pop().split('.').slice(0, -1).join('.').trim();
63+
const sanitizePath = potentialPath?.split("/").pop().split('.');
64+
let filename = "";
65+
if (sanitizePath.length > 1) {
66+
filename = sanitizePath.slice(0, -1).join('.').trim();
67+
} else {
68+
filename = sanitizePath[0];
69+
}
6470
if (filename) {
6571

6672
const filepath = config.source_data === SourceDataTypes.CURRENT_FOLDER ? `${view.file.parent.path}/${filename}.md` : `${config.source_destination_path}/${filename}.md`;

0 commit comments

Comments
 (0)