https://github.com/manasesjesus/csv-code-challenge
CSV file code challenge
https://github.com/manasesjesus/csv-code-challenge
code-challenge csv csv-parser csv-reader
Last synced: about 1 month ago
JSON representation
CSV file code challenge
- Host: GitHub
- URL: https://github.com/manasesjesus/csv-code-challenge
- Owner: manasesjesus
- License: mit
- Created: 2018-07-25T14:53:39.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2022-07-29T13:40:29.000Z (over 3 years ago)
- Last Synced: 2025-07-12T12:43:55.431Z (8 months ago)
- Topics: code-challenge, csv, csv-parser, csv-reader
- Language: JavaScript
- Homepage: https://manasesjesus.github.io/csv-code-challenge
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## JavaScript / HTML :: CSV File Code Challenge
Write a JavaScript / HTML program that lets the user open a CSV file from disk, displays it in a text box, processes it, and displays the output in another text box.
To read the input: The CSV file basically contains a 2D matrix of numbers, where each line holds a single row, e.g.: `2499\n`. The delimiter can be either space or a single comma (‘,’). Write the output in the same format as the input.
Once the input data is read, your application should perform filtering of “bad” values. Any entry of the matrix is “bad” when it has a value of 0 (zero). The application should now replace these bad values and compute the true value by interpolating it from the surrounding values, i.e., from the spatial neighbors of the entry in the matrix.
Write the matrix with the replaced values to the output text field.
## Solution
The file is read and processed using the FileReader functions. It separates the CSV headings from the values and process them. Everything gets stored in the textareas and the matrix (two-dimensional dynamic array).
To process the bad values, it searches for close good neighbors (west, east, north, south). If not close neighbors are found, it uses the Tesseract to find a further neighbor.
## Example