Skip to content

CSV parsing and data tranformation on JSON files in C

Notifications You must be signed in to change notification settings

tmooney84/csv_transform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

csv_transform

This project includes three different files that parse through and process CSV data into a JSON file.

  1. data_transform.c - This file parses through a CSV file and transforms particular pieces of data within the format:
Input: "Gender,FirstName,LastName,UserName,Email,Age,City,Device,Coffee Quantity,Order At\nMale,Carl,Wilderman,carl,wilderman_carl@yahoo.com,29,Seattle,Safari iPhone,2,2020-03-06 16:37:56\nMale,Marvin,Lind,marvin,marvin_lind@hotmail.com,77,Detroit,Chrome Android,2,2020-03-02 13:55:51\nFemale,Shanelle,Marquardt,shanelle,marquardt.shanelle@hotmail.com,21,Las Vegas,Chrome,1,2020-03-05 17:53:05\nFemale,Lavonne,Romaguera,lavonne,romaguera.lavonne@yahoo.com,81,Seattle,Chrome,2,2020-03-04 10:33:53\nMale,Derick,McLaughlin,derick,mclaughlin.derick@hotmail.com,47,Chicago,Chrome Android,1,2020-03-05 15:19:48\n"
Output: ["Gender,FirstName,LastName,UserName,Email,Age,City,Device,Coffee Quantity,Order At", "Male,Carl,Wilderman,carl,yahoo.com,21->40,Seattle,Safari iPhone,2,afternoon", "Male,Marvin,Lind,marvin,hotmail.com,66->99,Detroit,Chrome Android,2,afternoon", "Female,Shanelle,Marquardt,shanelle,hotmail.com,21->40,Las Vegas,Chrome,1,afternoon", "Female,Lavonne,Romaguera,lavonne,yahoo.com,66->99,Seattle,Chrome,2,morning", "Male,Derick,McLaughlin,derick,hotmail.com,41->65,Chicago,Chrome Android,1,afternoon"]
  1. csv_parser.c - This file transforms a CSV string into a 2-D array

  2. data_process.c - This file will take the output of data_tranform.c and it will return a JSON file.

Download

In order to download this set of parsing files:

using SSH:

git clone git@github.com:tmooney84/csv_transform.git

using https:

git clone https://github.com/tmooney84/csv_transform.git

About

CSV parsing and data tranformation on JSON files in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages