Skip to content

Commit

Permalink
upd Trim trailing whitespace on import
Browse files Browse the repository at this point in the history
  • Loading branch information
pchiorean committed May 31, 2022
1 parent 9bc3226 commit 41af4aa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cleanup/DefaultLayers.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Default layers 22.4.16
Default layers 22.5.24
(c) 2020-2022 Paul Chiorean (jpeg@basement.ro)
Adds/merges layers from a 6-column TSV file named 'layers.txt':
Expand Down Expand Up @@ -187,6 +187,7 @@ function main() {
continue;
}
if (!isHeaderFound) { isHeaderFound = true; continue; } // Header line, skip
record = record.replace(/^\s+|\s+$/g, '');
record = record.split(/ *\t */);
checkRecord();
}
Expand Down
3 changes: 2 additions & 1 deletion cleanup/DefaultSwatches.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Default swatches 22.4.16
Default swatches 22.5.24
(c) 2020-2022 Paul Chiorean (jpeg@basement.ro)
Adds swatches from a 5-column TSV file named 'swatches.txt':
Expand Down Expand Up @@ -178,6 +178,7 @@ function main() {
continue;
}
if (!isHeaderFound) { isHeaderFound = true; continue; } // Header line, skip
record = record.replace(/^\s+|\s+$/g, '');
record = record.split(/ *\t */);
checkRecord();
}
Expand Down
3 changes: 2 additions & 1 deletion cleanup/ReplaceFonts.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Replace fonts 22.4.16
Replace fonts 22.5.24
(c) 2020-2022 Paul Chiorean (jpeg@basement.ro)
Replaces fonts from a 4-column TSV file named 'fonts.txt':
Expand Down Expand Up @@ -131,6 +131,7 @@ function main() {
continue;
}
if (!isHeaderFound) { isHeaderFound = true; continue; } // Header line, skip
record = record.replace(/^\s+|\s+$/g, '');
record = record.split(/ *\t */);
checkRecord();
}
Expand Down
3 changes: 2 additions & 1 deletion cleanup/ReplaceLinks.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Replace links 22.4.16
Replace links 22.5.24
(c) 2020-2022 Paul Chiorean (jpeg@basement.ro)
Replaces document links from a 2-column TSV file named 'links.txt':
Expand Down Expand Up @@ -141,6 +141,7 @@ function main() {
continue;
}
if (!isHeaderFound) { isHeaderFound = true; continue; } // Header line, skip
record = record.replace(/^\s+|\s+$/g, '');
record = record.split(/ *\t */);
checkRecord();
}
Expand Down
3 changes: 2 additions & 1 deletion lib/ParseDataFile.jsxinc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Reads a TSV (tab-separated-values) file, returning an object containing found records and errors.
* Blank lines and those prefixed with `#` are ignored. A line ending in `\` continues on the next line.
* Include records from another file with `@path/to/include.txt` or the `@default` data file.
* @version 22.4.16
* @version 22.5.24
* @author Paul Chiorean <jpeg@basement.ro>
* @license MIT
* @param {File} dataFile - A tab-separated-values file (object).
Expand Down Expand Up @@ -45,6 +45,7 @@ function parseDataFile(dataFile, flgR) {
continue;
}
if (!isHeaderFound) { isHeaderFound = true; continue; } // Header line, skip
record = record.replace(/^\s+|\s+$/g, '');
record = record.split(/ *\t */);
checkRecord();
}
Expand Down

0 comments on commit 41af4aa

Please sign in to comment.