# From Text to Data: Lines, CSV and JSON Files

A file arrives as one long string, so a Node program splits CSV text into lines and fields, turns numbers from text into numbers, skips blank lines and reports bad rows, and reads and writes JSON files with JSON.parse and JSON.stringify.

![Cheat sheet: From Text to Data: Lines, CSV and JSON Files](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/3d1d4d336884479db29e0fed25d14277.webp)

- Category: Node.js
- Level: Apprentice
- Tags: CSV File, JavaScript, JSON (rest-api), JSON.parse(), JSON.stringify(), nodejs
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/node-files-text-to-data-cheat-sheet
