Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39349
| References | <CAFqGZRG3wVyf6jMBESjr6bmnLhLsT-_BG0xSH_rcpe4Oqb+1nQ@mail.gmail.com> <20130220102601.GD22457@localhost> <CAFqGZRG3RwgdSjDs1xRpv0YdEV0yXxeFJCefhP+w_6DEdwrwPQ@mail.gmail.com> <5124ADAB.6050305@davea.name> |
|---|---|
| Date | 2013-02-20 12:25 +0100 |
| Subject | Re: working with csv module in python |
| From | inshu chauhan <insideshoes@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2108.1361359540.2939.python-list@python.org> (permalink) |
[Multipart message — attachments visible in raw view] - view raw
On Wed, Feb 20, 2013 at 12:04 PM, Dave Angel <davea@davea.name> wrote: > On 02/20/2013 05:38 AM, inshu chauhan wrote: > >> On Wed, Feb 20, 2013 at 11:26 AM, Roland Koebler <r.koebler@yahoo.de> >> wrote: >> >> >>> <snip> >>> >>> >>> If you only want to concat the files, I would use some shell-tools, >>> like "cat" on Linux or "copy" on Windows, so >>> >>> copy C:\Users\inshu.chauhan\**Desktop\ForModel_600\*.arff >>> C:\Users\inshu.chauhan\**Desktop\test2.arff >>> >>> should do it. >>> >>> <snip> >>> >>> Yes I just want to concat the files , not parse/mangle the files. How >> can >> i simply read all files in a folder in my computer and write them into a >> single file ? just by 'printf ' is it possible ? >> >> >> >> > Reread Roland's message, quoted above for your convenience. > > Not sure what you mean by printf. Why would you use C to do it? > > If you need to do it in Python, remember you can read a file with the > read() method, and write one with the write() method. They pay no > attention to newlines, delimiters or anything else. Just create the output > file, then in a loop open the input files and loop through each (read > doesn't necessarily get the whole thing in one pass) > > You'll spend lots more energy on the mechanics of finding the files then > on the copying. But perhaps the shutil module will have some further > shortcuts. > > -- > DaveA > -- > http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list> > You are right Dave, printf was a blunder
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: working with csv module in python inshu chauhan <insideshoes@gmail.com> - 2013-02-20 12:25 +0100
csiph-web