Python script to fix CSV file

I export a cell phone log to csv once a month and in the caller-id field it sometimes places a comma between last and first and/initial so the csv thinks they are separate columns.


Extension, CallFrom, CallTime, CallTo...

1234,John Smith,12:05,Sally Smith (valid record)

1234,Smith,John, 12:05 (invalid)

So for example, above, the first record is good. Where the second record is bad. The name John becomes the Call Time value, and the CallTime value becomes CallTo... Etc.

Info: We know there are 13 columns in csv table. And we know the extra commas/field will only occur following the second comma (after CallerId column).

A good row/record will have 12 commas. Whereas a bad row/record will have 13 or 14 (depending if middle initial was used), e.g. Smith, John, P...

So programming logic would be something like...

Count(",") each row

If 12

Write row

If 13

Delete all characters between comma 2 and comma 3

Write row

If 14

Delete all characters between comma 2 and comma 4

Write row

Please ask me any questions. And I am open to any ideas or other solutions.

Квалификация: Python

Показать больше python programming ideas, Programming Logic, programming in python 3, data processing, excel, csv, logic it solutions, cell phone programming, write a python script, python script, invalid script, fix python, comma fix, table csv, csv table, python script convert file csv, python log file script, programming caller, python script convert text file csv file, python script parse text file csv file

О работодателе:
( 8 отзыв(-а, -ов) ) Lee, United States

ID проекта: #7510144



I'm just starting out on the freelance work, but I do this type of work day in day out and can easily provide you with what you need.

$15 USD за 1 день
(1 отзыв)

8 фрилансеров(-а) в среднем готовы выполнить эту работу за $21


hello, you can place your confidence in my Python knowledge and experience. your description looks well thought out, so we'll test if it works as you expect it to. greets, srdjan

$25 USD за 3 дней(-я)
(15 отзывов(-а))

hello there fellow, I could do this job in no time, just using some regexes on Python, look my last projects you sure will be glad with the results Rafael Aguilar [login to view URL]

$25 USD за 0 дней(-я)
(11 отзывов(-а))

I know python well. I can solve this in less than 2 hours. Ping me if you want to finish this off soon. You can check my python related work here .[login to view URL]

$20 USD за 1 день
(5 отзывов(-а))

Hi. Certainly i can done your project in few hours. I did complete 100% project for my employer quickly. Hope we have a deal. Thank you!

$25 USD за 0 дней(-я)
(6 отзывов(-а))

Hi, I am a graduate in CS and working as a Python programmer for 4+ years. I have done lots of assignments both in academic courses and in freelancer.com. I assure you of clean, efficient code with proper comment Больше

$30 USD за 1 день
(5 отзывов(-а))

I'll write the program today and send it through a message to you. If you like it you can hire me. I'll be writing it nonetheless and having other people rip you off for a few lines of code isn't nice.

$10 USD за 2 дней(-я)
(0 отзывов(-а))

Can you attach CSV so I can test Python script?

$15 USD за 1 день
(0 отзывов(-а))