Read file, reformat and write new file - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Read file, reformat and write new file (/thread-33902.html) |
Read file, reformat and write new file - bryanmartin113 - Jun-08-2021 Hi, I'm new to coding and struggling with a file that will take me an age to do manually. I have a file C:\file.txt in format at the bottom. I would like to run a script that reads the file at bottom and outputs in this format to a new file. Aaron View Residential Home30 beds, Contact, Owner: Mrs Karalia, Phone: 0114 286 9753, Email: [email protected], Website: www.superiorcarehomes.com \n Abberton Manor Nursing Home26 beds, Contact, Owner: Mrs Hooper, Phone: 01206 735590, Email: [email protected], Website: \n An excerpt of the original file C:\file.txt is here .... Aaron View Residential Home30 beds Contact Owner: Mrs Karalia Phone: 0114 286 9753 Email: [email protected] Website: www.superiorcarehomes.com Abberton Manor Nursing Home26 beds Contact Owner: Mrs Hooper Phone: 01206 735590 Email: [email protected] Website: Abbey Court Nursing Home22 beds Contact Owner: Mr & Mrs Persand Phone: 01474 854136 Email: [email protected] Website: Abbey Dale House Nursing Home26 beds Contact Owner: Mr Nadin Phone: 01492 530955 Email: [email protected] Website: www.adheare.co.uk Many thanks RE: Read file, reformat and write new file - Larz60+ - Jun-08-2021 Please read: https://python-forum.io/misc.php?action=help&hid=52 We will be glad to help, but you must make an effort. |