mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 22:19:36 +02:00
fix: removing empty lines
This commit is contained in:
@@ -20,7 +20,9 @@ export function csvRowsToColumns(
|
|||||||
const rows = input
|
const rows = input
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map((row) => row.split(','))
|
.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));
|
const columnCount = Math.max(...rows.map((row) => row.length));
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
for (let j = 0; j < columnCount; j++) {
|
for (let j = 0; j < columnCount; j++) {
|
||||||
|
Reference in New Issue
Block a user