Icon

Challenge 2 - Split File and Save Into Subfolders A.V

Split File and Save Into Subfolders - Solution

Challenge 2 - Split File and Save Into Subfolders

A pharmaceutical company used to keep its sales data in a CSV file. They ask for your help to split the data into monthly CSV files and to save them into different subfolders, where each subfolder corresponds to a year. As an example, the data for January 2015 should be stored in a file named 2015/January.csv. In your solution, remember to save the files and subfolders in the workflow data folder.

Dataset: https://kni.me/s/vrlYVaryZtBlyTsB

Challenge 2 - Split File and Save Into SubfoldersA pharmaceutical company used to keep its sales data in a CSV file. They ask for your help to split the data into monthly CSV files and to save them into differentsubfolders, where each subfolder corresponds to a year. As an example, the data for January 2015 should be stored in a file named 2015/January.csv. In your solution,remember to save the files and subfolders in the workflow data folder.Dataset: https://kni.me/s/vrlYVaryZtBlyTsB Convert using the right formatM/d/yyyyExtract Year andMonth (name) fieldsIterate through yearand monthCreate file path asYear/Month.csvConvert Year field to stringin order to use it in pathUse Year togenerate pathRead sales dataWrite each fileFilter columnsthat were notin the original data String to Date&Time Extract Date&TimeFields Group Loop Start Create File/FolderVariables Table Rowto Variable Number To String String to Path(Variable) Variable Loop End CSV Reader CSV Writer Column Filter Challenge 2 - Split File and Save Into SubfoldersA pharmaceutical company used to keep its sales data in a CSV file. They ask for your help to split the data into monthly CSV files and to save them into differentsubfolders, where each subfolder corresponds to a year. As an example, the data for January 2015 should be stored in a file named 2015/January.csv. In your solution,remember to save the files and subfolders in the workflow data folder.Dataset: https://kni.me/s/vrlYVaryZtBlyTsB Convert using the right formatM/d/yyyyExtract Year andMonth (name) fieldsIterate through yearand monthCreate file path asYear/Month.csvConvert Year field to stringin order to use it in pathUse Year togenerate pathRead sales dataWrite each fileFilter columnsthat were notin the original data String to Date&Time Extract Date&TimeFields Group Loop Start Create File/FolderVariables Table Rowto Variable Number To String String to Path(Variable) Variable Loop End CSV Reader CSV Writer Column Filter

Nodes

Extensions

Links