0

Hi All,

I am a newbie programmer in python and I am trying to read multiple csv files from a folder, replace the delimeter for all the csv files and then output these files into a new folder with replaced delimiter. So far I am stuck at the beginning. Please can someone point out some tips?

Thanks!

Edited by Reverend Jim: Moved to programming forum

4
Contributors
5
Replies
28
Views
6 Months
Discussion Span
Last Post by rproffitt
0

This job should not be written in code. It should be a single line command and what that command is may vary with the host OS.

Changing the delimeter could be done with the tr command. Read http://linuxcommand.org/lc3_man_pages/tr1.html
As to working the files from one directory to anoter, that's the old command line (dos style) for in (files.) do something.

Why code when it's one command line?

-1

Plus, if you are stuck at the beginning it's a good sign that you are biting off more than you can chew. Some people seem to think they can go from "hello, world" to complex applications without doing all the work in-between. I call this JBS for Jethro Bodine Syndrome. I'll be happy to explain that but I'd like to think there are a few other diinosaurs out there who will get the reference.

Votes + Comments
Encourage don't discourage. My biting off more than I can chew, (at the time), is what helped me grow as a programmer.
0

While I have your attention, will you please take the time to ensure that you are posting in the appropriate area of Daniweb?

Edited by Reverend Jim

0

Responses, ( 2-cents), to earlier responses.

rproffitt - coding a one liner is a way to make someting repeatable with less effort. Some-Programmer had to "code" when you drag & drop this icon over this folder it means move/copy it here. That's technically a single "MOVE" command but it's just easier and quicker than running in the Command Prompt. Also this could only be a part of a another program needing this feature.

Reverend Jim - Let's try to Encourage not discourage. My biting off more than I can chew, (at the time), is what helped me grow as a programmer. Let's not be Mr. Drysdale and tell everyone they can't, becuase he was proven wrong on many a times.

0

@d. If you want to repeat that one liner it goes into a script or batch file. Then there's no command prompt which seems to scare your new computer owners today.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.