<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Filework Notes]]></title><description><![CDATA[Filework Notes]]></description><link>https://filework-notes.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>Filework Notes</title><link>https://filework-notes.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 07:28:40 GMT</lastBuildDate><atom:link href="https://filework-notes.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building a CSV checker that leaves the decisions visible]]></title><description><![CDATA[A CSV checker can flag a suspicious value without knowing what that value should become. That distinction shaped CSV Import Preflight v0.1.0: inspect selected ID and amount columns, explain a limited ]]></description><link>https://filework-notes.hashnode.dev/building-a-csv-checker-that-leaves-the-decisions-visible</link><guid isPermaLink="true">https://filework-notes.hashnode.dev/building-a-csv-checker-that-leaves-the-decisions-visible</guid><category><![CDATA[csv]]></category><dc:creator><![CDATA[Xiang]]></dc:creator><pubDate>Wed, 16 Sep 2026 06:10:43 GMT</pubDate><content:encoded><![CDATA[<p>A CSV checker can flag a suspicious value without knowing what that value should become. That distinction shaped CSV Import Preflight v0.1.0: inspect selected ID and amount columns, explain a limited set of risks, and leave the input unchanged.</p>
<p>The useful question is not simply whether a value looks numeric. It is whether the destination might interpret the text differently from its intended meaning. Three implementation choices keep that uncertainty visible.</p>
<h2>Keep the evidence as text</h2>
<p>The parser in <code>preflight.js</code> keeps parsed field values as strings. For example, <code>000042</code> and <code>12345678901234567890</code> are synthetic identifiers, not customer records. Converting them to numbers before checking them would undermine the evidence the checker needs: the leading zeros and exact sequence of digits.</p>
<p>Here, “preserve” means retaining the parsed field text, not reproducing the original CSV bytes. CSV quoting is decoded during parsing. Each finding includes the original parsed value, a logical record number, the record’s starting line, and the selected column. Those two location numbers matter because a quoted field can contain a newline: one record need not occupy one physical line.</p>
<p>The checks can use a trimmed copy for comparison while reporting the untrimmed field value. Outside whitespace becomes a finding, rather than a silent correction. The parser also rejects malformed quoting and records with unexpected field counts instead of trying to guess the missing structure.</p>
<h2>Share the rules across two interfaces</h2>
<p>The browser interface in <code>app.js</code> and the command-line interface in <code>cli.js</code> both call the same <code>audit</code> function. The core module exposes it through a browser global or CommonJS, keeping the checking rules in one place.</p>
<p>This is a small architectural choice with a practical benefit: changing a rule does not require separately reimplementing it for two interfaces. The wrappers handle different jobs. The browser gathers column selections and displays findings; the command line reads a file and produces a JSON report. Sharing the engine reduces opportunities for drift, although it does not by itself prove that both wrappers behave correctly.</p>
<h2>Ask for meaning instead of inventing a repair</h2>
<p>Consider the synthetic amount <code>1,234</code>, quoted when it appears in a comma-delimited CSV. With the decimal convention unknown, the engine checks dot-decimal and comma-decimal interpretations. When both fit but imply different values, it flags ambiguity.</p>
<p>The next step is to confirm the source convention. The checker does not choose a locale from one cell, rewrite the amount, or recover digits already lost upstream. Users select which columns represent IDs or amounts; header-name suggestions are only a starting point.</p>
<p>The repository’s <code>test/preflight.test.js</code> makes these boundaries inspectable through synthetic cases for leading zeros, long IDs, quoted multiline fields, ambiguous amounts, and malformed input.</p>
<p>The result is deliberately a review report, not a cleaned CSV. It checks selected columns against listed heuristics. A report with no findings is not approval to import, and a downloaded report may contain original values that need care before sharing.</p>
<p>Project: <a href="https://csv-import-preflight.gx01718.chatgpt.site/">CSV Import Preflight</a>.</p>
<p>Chris</p>
]]></content:encoded></item><item><title><![CDATA[One comma. Two different numbers.]]></title><description><![CDATA[A file can look clean and still carry the wrong value. The text 1,234 can mean one point two three four when the comma is a decimal symbol, or one thousand two hundred thirty-four when it groups thous]]></description><link>https://filework-notes.hashnode.dev/one-comma-two-different-numbers</link><guid isPermaLink="true">https://filework-notes.hashnode.dev/one-comma-two-different-numbers</guid><category><![CDATA[csv]]></category><category><![CDATA[excel]]></category><dc:creator><![CDATA[Xiang]]></dc:creator><pubDate>Tue, 08 Sep 2026 08:21:10 GMT</pubDate><content:encoded><![CDATA[<p>A file can look clean and still carry the wrong value. The text <code>1,234</code> can mean one point two three four when the comma is a decimal symbol, or one thousand two hundred thirty-four when it groups thousands. The string alone does not tell a converter which interpretation is intended.</p>
<p>For quantities, you may want a consistent decimal symbol. For an identifier, every character can matter. Before converting a batch, write down what must stay exactly the same.</p>
<h2>Three separators, three different jobs</h2>
<p>Keep the original file unchanged. A <strong>field delimiter</strong> separates columns; a <strong>decimal symbol</strong> separates the whole and fractional parts of a value; a <strong>thousands separator</strong> groups digits. Agree on each separately.</p>
<p>For example, <code>1.234,50;002,00</code> contains two fields when the delimiter is a semicolon. With a decimal comma and grouping dot, the first value becomes <code>1234.50</code>. Under the same rules, the second becomes <code>002.00</code>: its leading zeros are retained.</p>
<p>In comma-delimited CSV, a field containing a comma needs quoting: <code>"1,234"</code>. The informational <a href="https://www.rfc-editor.org/rfc/rfc4180">RFC 4180</a> describes CSV quoting and escaping, not the business meaning of a number. The semicolon example uses a different delimiter.</p>
<p>If one column contains both decimal conventions, confirm a rule for the affected records. A plausible-looking result is not enough.</p>
<h2>Make preservation visible</h2>
<p>These are the first three amount changes from my synthetic test. The rule was explicit: semicolon delimiter, decimal comma, grouping dot. The converter treats data as strings, so it does not pass identifiers through floating-point arithmetic.</p>
<p>The first record ID was <code>100000000000000000001</code>. It remained exactly the same in the output.</p>
<table>
<thead>
<tr>
<th>Data row</th>
<th>Source amount</th>
<th>Output amount</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td><code>1.234,50</code></td>
<td><code>1234.50</code></td>
</tr>
<tr>
<td>2</td>
<td><code>1.235,50</code></td>
<td><code>1235.50</code></td>
</tr>
<tr>
<td>3</td>
<td><code>1.236,50</code></td>
<td><code>1236.50</code></td>
</tr>
</tbody></table>
<p>The tested batch contained 25,000 data records across two files. All 75,000 data cells were checked against expected strings, and all 21-digit IDs were retained. This is a synthetic demonstration, not a customer case study.</p>
<p>Preservation in the CSV does not control how another application opens it. Import settings still matter.</p>
<h2>Try the tools you already have</h2>
<p>Microsoft documents how automatic conversion can remove leading zeros and truncate numeric precision after 15 significant digits. A long identifier should be imported as text. Setting it to text after digits have been lost will not restore them.</p>
<ol>
<li>Start from the untouched source file.</li>
<li>Use <strong>Data → From Text/CSV</strong>, then open the transformation editor.</li>
<li>Set identifier columns to <strong>Text</strong> before numeric conversion. Check the delimiter and the locale used for amount columns.</li>
<li>Preview representative records before loading the result.</li>
</ol>
<p>These steps are adapted from <a href="https://support.microsoft.com/en-us/office/keeping-leading-zeros-and-large-numbers-1bf7b935-36e1-4985-842f-5dfa51f85fe7">Microsoft's import guidance</a>. Menu names vary by version. These are documentation-based instructions; I have not tested every Excel edition.</p>
<p><a href="https://openrefine.org/docs/manual/cellediting">OpenRefine</a> is another option for inspecting and editing tabular data. For a small one-off job, an existing tool may already give you a result you can verify.</p>
<h2>Some findings should stop an export</h2>
<p>In the companion review example, an unresolved value prevents the whole batch from producing a processed CSV or delivery ZIP. Proposed changes remain visible in the diagnostic log; they are not a completed delivery.</p>
<ul>
<li><strong>Count the records.</strong> Explain any difference between input and output.</li>
<li><strong>Compare exact strings.</strong> Inspect long IDs, leading zeros, signs and fractional zeros.</li>
<li><strong>Review exceptions.</strong> Mixed separators, unexpected text and malformed groups need a decision.</li>
<li><strong>Agree on duplicates.</strong> An identical row can be a valid repeated transaction. This workflow flags exact repeated source rows by default; removal requires an agreed rule.</li>
</ul>
<p>Format checks cannot establish whether a value is commercially correct. Confirm the intended interpretation against a trusted source before using the output.</p>
<h2>Inspect the actual demonstration</h2>
<p>The <a href="https://filework-notes.gx01718.chatgpt.site/downloads/numeric-csv-demonstration.zip">complete demonstration pack</a> contains synthetic inputs, processed outputs for the passing batch, full change logs, and reports from both actual test runs. The unresolved review batch deliberately has no processed output.</p>
<p>You can also read the <a href="https://filework-notes.gx01718.chatgpt.site/downloads/passed-report.pdf">passing-batch report</a> and <a href="https://filework-notes.gx01718.chatgpt.site/downloads/review-report.pdf">review-required report</a> separately. The PDFs contain limited previews; the JSONL files contain the full logs. Open raw CSV and JSONL in a text editor first so a spreadsheet does not silently reinterpret the values.</p>
<p>This article is adapted from my original <a href="https://filework-notes.gx01718.chatgpt.site">Filework Notes guide</a>. I run Filework Notes; that page also describes an optional paid service for a defined numeric CSV batch. The guide, reports and demonstration pack are free to inspect, with no signup required.</p>
]]></content:encoded></item></channel></rss>