0

i want to change data from csv files to update in my database:

Their are like that:

01;NAME SECONDNAME LASTNAME;STREET ADDRESS;548
02;NAME SECONDNAME LASTNAME;STREET ADDRESS;421

I want to make it:

01;Name Secondname Lastname;Street Address;548
02;Name Secondname Lastname;Street Address;421
martineau
  • 112,593
  • 23
  • 157
  • 280

1 Answers1

0

You can use str.title():

with open('text.txt','r') as f:
    t = f.read().title()
with open('text.txt','w') as f:
    f.write(t)
Ann Zen
  • 25,080
  • 7
  • 31
  • 51