A Node.js application to fix and format CSV files with common issues like unclosed quotes, broken lines, and inconsistent formatting.
- Node.js 16 or higher
- Git (for cloning the repository)
Clone from Repository
# Clone the repository
git clone https://github.com/flaviosp15/csv-line-fixer.git
cd csv-line-fixer- Start the application:
node app.js- Enter the CSV file path when prompted:
Enter the path of your input file: /path/to/your/file.csv
- Let it process - The app will:
- β Validate your file path and extension
- β Create a fixed version with FIXED- prefix
- β Show processing time and completion status
- Removes blank lines and empty value rows
- Fixes unclosed quotes across multiple lines
- Normalizes spaces and quote formatting
- Handles large files efficiently with stream processing
- Validates input with clear error messages
Creates a new file in the same directory with FIXED- prefix:
- Input:
my-file.csv - Output:
FIXED-my-file.csv
The app checks for:
- β CSV file extension (.csv or .CSV)
- β File existence and read permissions
- β Valid file (not a directory)
Windows:
Enter the path of your input file: C:\Users\name\data\file.csv
Mac/Linux:
Enter the path of your input file: ./data/file.csv
- Processes files line by line using streams
- Low memory usage even for large files
- Displays processing time upon completion
Common issues:
- Ensure file has
.csvextension - Check file exists at the specified path
- Verify read permissions for the file