i have a config.json file and the data inside the config.json is ""
{
"mortalityfile":"C:/Users/DELL/mortality.csv"
}
and the mortality file is a csv file with some data..i want to extract the csv file data from the cofig.json.The code which i wrote is
js = open('config.json').read()
results = []
for line in js:
words = line.split(',')
results.append((words[0:]))
print(results)
and i am geeting the output as the sourcefilename which i given..
[['{'], ['\n'], [' '], [' '], [' '], [' '], ['"'], ['m'], ['o'], ['r'], ['t'], ['a'], ['l'], ['i'], ['t'], ['y'], ['f'], ['i'], ['l'], ['e'], ['"'], [':'], ['"'], ['C'], [':'], ['/'], ['U'], ['s'], ['e'], ['r'], ['s'], ['/'], ['D'], ['E'], ['L'], ['L'], ['/'], ['m'], ['o'], ['r'], ['t'], ['a'], ['l'], ['i'], ['t'], ['y'], ['.'], ['c'], ['s'], ['v'], ['"'], ['\n'], [' '], [' '], [' '], [' '], ['\n'], ['}']]
i want to extract the data which is stored in the csv file through config.json in the python