I am trying to convert Applications column in array as i have marked in screenshot. The problem i am facing through this process is converting CSV file data in array to mongodb. I am using python language to work with database.
Currently:
{'Applications': 'Chrysler 200 2014-2011, Cirrus 2009-2006, Cirrus (Mex) 2008-2006, Sebring 2010-2007, Town & Country 2010-2001, Voyager 1999-1996, Voyager 2008-2001, Voyager (Mex) 1999-1996, Voyager (Mex) 2002-2001, Voyager (Mex) 2008-2004, Dodge Avenger 2014-2008, Caravan 2007-2001, Grand Caravan 2010-2001, Volkswagen Routan 2010-2009, Routan Exclusive (Mex) 2010, Routan Prestige (Mex) 2010'}
Expecting (in array):
{'Applications': [Chrysler 200 2014-2011, Cirrus 2009-2006, Cirrus (Mex) 2008-2006, Sebring 2010-2007, Town & Country 2010-2001, Voyager 1999-1996, Voyager 2008-2001, Voyager (Mex) 1999-1996, Voyager (Mex) 2002-2001, Voyager (Mex) 2008-2004, Dodge Avenger 2014-2008, Caravan 2007-2001, Grand Caravan 2010-2001, Volkswagen Routan 2010-2009, Routan Exclusive (Mex) 2010, Routan Prestige (Mex) 2010']}
I am not sure if this what you are looking for but I guess the Application
is the key for the string 'Chrysler 200 2014-2011,............
.
You could just read the value of Application and then split it with ','
delimiter to get the list of elements in the array in python, as shown in the below code and convert the string into array in python.
Code:
data = {'Applications': 'Chrysler 200 2014-2011, Cirrus 2009-2006, Cirrus (Mex) 2008-2006, Sebring 2010-2007, Town & Country 2010-2001, Voyager 1999-1996, Voyager 2008-2001, Voyager (Mex) 1999-1996, Voyager (Mex) 2002-2001, Voyager (Mex) 2008-2004, Dodge Avenger 2014-2008, Caravan 2007-2001, Grand Caravan 2010-2001, Volkswagen Routan 2010-2009, Routan Exclusive (Mex) 2010, Routan Prestige (Mex) 2010'}
arr = data['Applications'].split(',')
print(arr)
Output:
['Chrysler 200 2014-2011', ' Cirrus 2009-2006', ' Cirrus (Mex) 2008-2006', ' Sebring 2010-2007', ' Town & Country 2010-2001', ' Voyager 1999-1996', ' Voyager 2008-2001', ' Voyager (Mex) 1999-1996', ' Voyager (Mex) 2002-2001', ' Voyager (Mex) 2008-2004', ' Dodge Avenger 2014-2008', ' Caravan 2007-2001', ' Grand Caravan 2010-2001', ' Volkswagen Routan 2010-2009', ' Routan Exclusive (Mex) 2010', ' Routan Prestige (Mex) 2010']
Note: I am not sure this is what you wanted. But hope this helps.