This repository contains a CSV parser that gets student infos, organize them and turn into an JSON file.
- For example, the texts will always be "Classe n ", "Sala n", "Turma n" (n being a random number) or "Diurno"/"Noturno"/"Integral"
- So if there is an different input, like "Disciplina SI198", the program will not recognize it as a group
- So they will be parsed and formated using the Brazilian patterns
- So if there's another kind of input, for example 'whatsapp Pedagogical Responsible' it will not be recognized as an address
- The CSV file must be in the same directory that "index.js"
To run the code you can open the directory where the project is located on your command prompt and run the next 2 commands:
npm install package.json
node index.js
C:\Users\user> cd C:\Users\user\Documents\Projects\CSV-to-JSON-NodeJs\
C:\Users\user\Documents\Projects\CSV-to-JSON-NodeJs> npm install package.json
C:\Users\user\Documents\Projects\CSV-to-JSON-NodeJs> node index.js
----------------------
Starting program, reading 'input.csv'
----------------------
Adding new student
----------------------
Invalid phone number: kkkkkkk / From person: John Appleseed / Tag: [ 'Student' ]
----------------------
Adding info to already existent student, eid: 104 / Name: John Appleseed
----------------------
Null email from person: John Appleseed / Tag: [ 'Financial', 'Responsible' ]
----------------------
Null phone number from person: John Appleseed / Tag: [ 'Financial', 'Responsible' ]
----------------------
Adding new student
----------------------
Null phone number from person: Mary Knight / Tag: [ 'Pedagogical', 'Responsible' ]
----------------------
Null phone number from person: Mary Knight / Tag: [ 'Financial', 'Responsible' ]
----------------------
Writing data in output.json
----------------------
Program finished