Python Forum
Reading and writing to text file has format change
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading and writing to text file has format change
#2
You are adding a line feed ('\n') to the write buffer here:
for row in xdata:
f.write('%s\n' % row)
so you are not writing out what you read in.
Reply


Messages In This Thread
RE: Reading and writing to text file has format change - by Larz60+ - Dec-14-2017, 03:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What does .flush do? How can I change this to write to the file? Pedroski55 3 327 Apr-22-2024, 01:15 PM
Last Post: snippsat
  Help with writing monitored data to mysql upon change of one particular variable donottrackmymetadata 3 385 Apr-18-2024, 09:55 PM
Last Post: deanhystad
Sad problems with reading csv file. MassiJames 3 728 Nov-16-2023, 03:41 PM
Last Post: snippsat
  Reading a file name fron a folder on my desktop Fiona 4 1,006 Aug-23-2023, 11:11 AM
Last Post: Axel_Erfurt
  logging: change log file permission with RotatingFileHandler erg 0 1,126 Aug-09-2023, 01:24 PM
Last Post: erg
  How can I change the uuid name of a file to his original file? MaddoxMB 2 1,005 Jul-17-2023, 10:15 PM
Last Post: Pedroski55
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,163 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 1,001 Feb-15-2023, 05:34 PM
Last Post: zsousa
  Reading a file JonWayn 3 1,152 Dec-30-2022, 10:18 AM
Last Post: ibreeden
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,175 Dec-15-2022, 04:32 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020