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
  • 119,623
  • 25
  • 170
  • 301

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)
Red
  • 26,798
  • 7
  • 36
  • 58