I have a web scraper that saves the scrapes data into a CSV file. The data looks like this:
random text Johm May 1234 Big Street Atlanta, GA 30331 acre .14 small random text Jane Jones 4321 Little Street Atlanta, GA 30322 acre .07 small random text
I would like to:
(1) Add in the columns Name,Street,,Address <--- Note that this sample is delimited by a comma.
(2) I would like to add commas to the address results I posted above. An example would be:
jane jones ,4321 Little Street ,,Atlanta, GA 30344 ,,,acre .07 small ,,,random text
Note how the commas are used to push each line to the desired column with the unneeded data acre .07 small and random text being pushed away from the named columns.
How do I do this in python? I can do it by hand, but I'm dealing with thousands of address and I need a simple way to do this in python.
Is it possible to pull all the data into a list after if has been scraped, and to assign a variable for the commas like a = , b = ,, c = ,,, and then to join the variable to a specific line in the list, and then to save it again?
Also, I need to add the column info as well: columns Name,Street,,Address