Member Avatar

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?


Recommended Answers

All 5 Replies

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
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?

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.

commented: 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?

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.

@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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.