Menu

A CSV row filter that never uploads your file
📰

A CSV row filter that never uploads your file

DEV Community: javascript·dark·about 23 hours ago
#Rsv4jLWW
#devtojavascript#devto#dev#rows#file
Reading 0:00
15s threshold

I make small browser-only tools, mostly for text and CSV cleanup. This one exists because I had two stock files and a SKU list, and I wasn't going to upload a supplier inventory to a website I found on Google.

The job is simple: keep the rows in A that are not in B. Pick the key column in each file, compare, download what's left.

The first version only matched one column, and that's where it went wrong. In the screenshot, A is matched to B on sku alone. Six rows in, two matched, four left. The two that went were ACME/100 and BETA/100. Only one of them was the row I meant to remove. Same SKU, different supplier, so "duplicate" was the wrong word for one of them.

I could have added a warning. Instead I added a second key, so supplier + SKU has to match together. A single key is still the default, and there's a case toggle for emails, because CARL@ and carl@ are the same person while two codes that differ by case usually are not.

Under the hood it's nothing clever.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.