Warning: session_start(): open(/opt/alt/php73/var/lib/php/session/sess_5e94a191f3b2014c1b2cc9b52528d626, O_RDWR) failed: Disk quota exceeded (122) in /home/z7uawk7ew81l/domains/olapersson.com/html/index.php on line 3

Warning: session_start(): Failed to read session data: files (path: /opt/alt/php73/var/lib/php/session) in /home/z7uawk7ew81l/domains/olapersson.com/html/index.php on line 3
Things by Ola Persson - Page 4 of 4

Concat CSV

Concatinate all csv files in a folder into one file. With the same or different columns / column order.

Sometimes you need to do something, that at first glance looks super easy. But when proves itself difficult and hard to google. This was the case trying to append / concatinate several hundreds of csv files, I had in the same folder, into one file. Simple solutions like cat terminal command did not work, as the column count and order differed.

Heres my solution, if you ever find yourself in my situation. You need to have Node Js installed. Then download the program, and cd the program folder in terminal and write:

node concat-csv.js in=/folder/with/csv/to/merge/ out=/where/to/output/ delimiter=,

Where delimiter is a single character, like , (comma) or any other character that your csv files use for delimiting.

4 of 4