I am new to programming and have been reading a few books on Pyhton but can't seem to grasp what I believe is probably a simple process. I need someone to show me briefly a sample script that would allow me to open a CSV file and edit it line by line. This is an example of part of the CSV file I have.
Links:
0. blog ==> http://blog.example.com/
1. site map ==> http://www.example.com/site-map
2. customer log in ==> http://www.example.com/customer-login
3. ==> http://www.example.com/
4. ==> javascript:openChat('http://server.iad.liveperson.net/hc/53450382/?cmd=file&file=visitorWantsToChat&site=53450382&byhref=1')
5. Products ==> http://www.example.com/products
6. Services ==> http://www.example.com/services
7. Become a Customer ==> http://www.example.com/become-a-customer
8. Contact Us ==> http://www.example.com/contact
9. About Us ==> http://www.example.com/about
10. Learning Center ==> http://www.example.com/LearningCenter
I want to remove certain things from each line, for example the numbers at the beginning of each line, entire lines that have certain words, etc. This is a very short part of the entire file but from this all I would want left is a new file containing this:
http://www.example.com/products
I can't figure out how to create a script that would weed through a CSV file and remove portions of lines or entire lines depending on the content.
Any help in the right direction would be much appreciated. Thanks.