Menu

Your CSV import works on your laptop. Then a customer in Germany uploads a file.
πŸ“°

Your CSV import works on your laptop. Then a customer in Germany uploads a file.

DEV Community: typescriptΒ·KevinXiaoΒ·5 days ago
#ReL09oOX
#devtotypescript#devto#dev#bytes#const
Reading 0:00
15s threshold

A first CSV import often looks like this:

const text = await file . text ( ) ; const rows = text . trim ( ) . split ( '\n' ) . map ( ( line ) => line . split ( ',' ) ) ;

Enter fullscreen mode

Exit fullscreen mode

It works on the Google Sheets export you used for testing. Then a support ticket arrives:

"The import says every row is invalid. It's the same spreadsheet we use every month."

You open their file:

ID ; Name ; Email ; Plan ; Seats ; MRR ; Country C - 3001 ; Jos οΏ½ Mart οΏ½ nez ; jose @ example . es ; Pro ; 6 ; 299 , 00 ; ES

Enter fullscreen mode

Exit fullscreen mode

That one line hides three everyday Excel problems outside the US β€” and your two-liner hits all of them:

Encoding isn't UTF-8 β†’ accented letters become οΏ½ ( file.text() always decodes UTF-8).

Delimiter is ; β†’ European Excel uses semicolon when comma is the decimal separator.

299,00 is a number β†’ decimal comma, not "invalid".

Add two more traps that show up the same week: newlines inside quoted fields , and dates like 05/03/2025…

Continue reading β€” create a free account

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