mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-11 02:29:54 +05:30
fix: removing empty lines
This commit is contained in:
parent
68976a48f6
commit
39cf7aa4e3
1 changed files with 3 additions and 1 deletions
|
|
@ -20,7 +20,9 @@ export function csvRowsToColumns(
|
|||
const rows = input
|
||||
.split('\n')
|
||||
.map((row) => row.split(','))
|
||||
.filter((row) => !row[0].trim().startsWith(commentCharacter));
|
||||
.filter(
|
||||
(row) => row.length > 1 && !row[0].trim().startsWith(commentCharacter)
|
||||
);
|
||||
const columnCount = Math.max(...rows.map((row) => row.length));
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
for (let j = 0; j < columnCount; j++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue