<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dark Star</title>
    <description>The latest articles on DEV Community by Dark Star (@darkness_c8f5d00f0e37324d).</description>
    <link>https://dev.to/darkness_c8f5d00f0e37324d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4075111%2F6024942b-b1a1-446f-9354-5ea2a4dbf165.gif</url>
      <title>DEV Community: Dark Star</title>
      <link>https://dev.to/darkness_c8f5d00f0e37324d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/darkness_c8f5d00f0e37324d"/>
    <language>en</language>
    <item>
      <title>How to Compare Two Large CSV Files Without Uploading the Data</title>
      <dc:creator>Dark Star</dc:creator>
      <pubDate>Sat, 15 Aug 2026 11:05:22 +0000</pubDate>
      <link>https://dev.to/darkness_c8f5d00f0e37324d/how-to-compare-two-large-csv-files-without-uploading-the-data-1nnm</link>
      <guid>https://dev.to/darkness_c8f5d00f0e37324d/how-to-compare-two-large-csv-files-without-uploading-the-data-1nnm</guid>
      <description>&lt;p&gt;Comparing two CSV exports sounds simple until the files get large.&lt;/p&gt;

&lt;p&gt;A common situation is having an older export and a newer export and wanting to answer four questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which rows were added?&lt;/li&gt;
&lt;li&gt;Which rows were removed?&lt;/li&gt;
&lt;li&gt;Which existing rows were modified?&lt;/li&gt;
&lt;li&gt;Which rows are unchanged?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simple row-by-row comparison isn't reliable when the order of rows changes between exports. What you really want is to identify the same record in both files using a stable key, then compare the records associated with that key.&lt;/p&gt;

&lt;h2&gt;
  
  
  The basic approach
&lt;/h2&gt;

&lt;p&gt;For each CSV:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parse the headers and rows.&lt;/li&gt;
&lt;li&gt;Identify a suitable column that can act as the record key.&lt;/li&gt;
&lt;li&gt;Build a lookup of &lt;code&gt;key → row&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Compare the keys present in each file.&lt;/li&gt;
&lt;li&gt;For keys present in both files, compare their values.&lt;/li&gt;
&lt;li&gt;Classify the result as modified or unchanged.&lt;/li&gt;
&lt;li&gt;Keys existing in only one file become added or removed records.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This turns the problem into a lookup/comparison problem instead of repeatedly scanning the entire second file for every row.&lt;/p&gt;

&lt;h2&gt;
  
  
  The browser-only part
&lt;/h2&gt;

&lt;p&gt;There is another consideration when the CSV contains business or customer data.&lt;/p&gt;

&lt;p&gt;Instead of uploading the files to a server, the entire comparison can happen in the browser. The files can be read locally, processed locally, and discarded when the page is closed.&lt;/p&gt;

&lt;p&gt;That means there is no server-side CSV processing involved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then I hit another problem: large files
&lt;/h2&gt;

&lt;p&gt;Testing with a small CSV is easy.&lt;/p&gt;

&lt;p&gt;Testing with a few hundred thousand rows is where things get interesting.&lt;/p&gt;

&lt;p&gt;The comparison itself can complete successfully, but rendering hundreds of thousands of result rows into the DOM is a terrible idea. The browser can become unresponsive simply because it is trying to create an enormous number of HTML elements.&lt;/p&gt;

&lt;p&gt;The solution is to separate &lt;strong&gt;data processing&lt;/strong&gt; from &lt;strong&gt;data rendering&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The complete comparison result can remain in memory, while the UI only renders a small portion of it at a time.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;293,000 unchanged rows

Page 1 → rows 1–100
Page 2 → rows 101–200
Page 3 → rows 201–300
...
Page 2,930 → rows 292,901–293,000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The user still has access to the complete result, but the browser only has to render the current page.&lt;/p&gt;

&lt;p&gt;This also means exports can continue using the complete result rather than whatever happens to be visible on screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSVCompare
&lt;/h2&gt;

&lt;p&gt;I ended up building a small browser-based tool while working through these problems:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSVCompare:&lt;/strong&gt; &lt;a href="https://csvcompare.pages.dev" rel="noopener noreferrer"&gt;https://csvcompare.pages.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It compares two CSV files, automatically detects the best key, and separates the results into modified, added, removed, and unchanged records.&lt;/p&gt;

&lt;p&gt;The tool processes the CSV files locally in the browser.&lt;/p&gt;

&lt;p&gt;This started as a small experiment, so I'm particularly interested in feedback from people who regularly work with CSV exports, data migrations, or recurring snapshots.&lt;/p&gt;

&lt;p&gt;What approach do you use when you need to compare two large CSV exports?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>I built a browser-based CSV comparison tool for large data exports</title>
      <dc:creator>Dark Star</dc:creator>
      <pubDate>Wed, 12 Aug 2026 17:17:27 +0000</pubDate>
      <link>https://dev.to/darkness_c8f5d00f0e37324d/i-built-a-browser-based-csv-comparison-tool-for-large-data-exports-4f4j</link>
      <guid>https://dev.to/darkness_c8f5d00f0e37324d/i-built-a-browser-based-csv-comparison-tool-for-large-data-exports-4f4j</guid>
      <description>&lt;p&gt;Comparing two CSV exports sounds simple until you're dealing with thousands of rows and need to figure out what actually changed.&lt;/p&gt;

&lt;p&gt;I built CSVCompare to solve exactly that.&lt;/p&gt;

&lt;p&gt;You drop in the before and after CSV files, and it automatically detects the best key and separates the differences into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modified&lt;/li&gt;
&lt;li&gt;Added&lt;/li&gt;
&lt;li&gt;Removed&lt;/li&gt;
&lt;li&gt;Unchanged&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything runs entirely in the browser. The CSV files aren't uploaded to a server.&lt;/p&gt;

&lt;p&gt;I also wanted it to remain useful for larger exports rather than forcing everything into a spreadsheet and manually comparing rows.&lt;/p&gt;

&lt;p&gt;Try it here:&lt;br&gt;
&lt;a href="https://csvcompare.pages.dev" rel="noopener noreferrer"&gt;https://csvcompare.pages.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a small independent experiment, and I'm mainly interested in whether this solves a problem other developers actually have. Feedback is welcome.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
