Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'output': 0.04; 'method.': 0.05; 'method,': 0.07; 'shutil': 0.07; 'read()': 0.09; 'subject:module': 0.09; 'windows,': 0.09; 'cc:addr:python- list': 0.10; 'subject:python': 0.11; 'files.': 0.13; 'file,': 0.15; '(read': 0.16; '12:04': 0.16; 'concat': 0.16; 'copying.': 0.16; 'delimiters': 0.16; 'printf': 0.16; 'wed,': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'input': 0.18; 'feb': 0.19; 'module': 0.19; 'cc:2**0': 0.23; 'linux': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'url:mailman': 0.29; 'skip:& 10': 0.29; 'folder': 0.30; 'url:python': 0.32; 'file': 0.32; 'url:listinfo': 0.32; 'received:google.com': 0.34; 'open': 0.35; 'pm,': 0.35; 'but': 0.36; 'url:org': 0.36; 'anything': 0.36; 'subject:with': 0.36; 'should': 0.36; 'possible': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'mean': 0.38; 'some': 0.38; 'sure': 0.38; 'url:mail': 0.40; 'your': 0.60; 'further': 0.61; "you'll": 0.62; 'necessarily': 0.63; 'more': 0.63; '20,': 0.65; 'else.': 0.65; 'skip:c 50': 0.66; 'attention': 0.75; '2013': 0.84; 'mechanics': 0.84; '\xa0but': 0.84; 'write()': 0.91; 'angel': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=A90rPPVJ5TUYRo1t666r3iDPYnqEtoUr144+cxgVDeQ=; b=z3NjTU7yTyELELzW66dTR9d1nYp01nXVCjF6H+882fd477h6KZvQp/lJW/Wp6tkBS4 w20iZxZnxJEKt4u/KQOy6oRGQKcvTvDp0+i2HRxnL7ft2HNVedqRNDY3JHrwpJS0i21c 1EgS7Izogrcyziv9XqG/YcGviENrYwkM47qeN5jxB8Auu6kZ+nCehlWmyeC7FoPqMQtR gfaqvZWtiSqMpnHcGjzIXwIM5LfBjDUjp+mIgXwJcSsAyeKAjJvpiJ8MsSqFqcs7kdpD DHgYkW0uc6pnc3G8/pnGmc/TJAzWwYX2p6lOZBmUAXGBLrujNuSOrUp6gBcz/ak1CkQd n5Aw== MIME-Version: 1.0 X-Received: by 10.50.186.169 with SMTP id fl9mr3260981igc.72.1361359537824; Wed, 20 Feb 2013 03:25:37 -0800 (PST) In-Reply-To: <5124ADAB.6050305@davea.name> References: <20130220102601.GD22457@localhost> <5124ADAB.6050305@davea.name> Date: Wed, 20 Feb 2013 12:25:37 +0100 Subject: Re: working with csv module in python From: inshu chauhan To: Dave Angel Content-Type: multipart/alternative; boundary=14dae9340b81a9e32904d626377b Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 121 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361359540 news.xs4all.nl 6953 [2001:888:2000:d::a6]:37127 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39349 --14dae9340b81a9e32904d626377b Content-Type: text/plain; charset=ISO-8859-1 On Wed, Feb 20, 2013 at 12:04 PM, Dave Angel wrote: > On 02/20/2013 05:38 AM, inshu chauhan wrote: > >> On Wed, Feb 20, 2013 at 11:26 AM, Roland Koebler >> wrote: >> >> >>> >>> >>> >>> 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. >>> >>> >>> >>> 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 > You are right Dave, printf was a blunder --14dae9340b81a9e32904d626377b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Wed, Feb 20, 2013 at 12:04 PM, Dave Angel <= davea@davea.name&= gt; wrote:
On 02/20/2013 05:38 AM, in= shu 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.

=A0 <snip>

Yes I just want to concat the files , not parse/mangle the files. =A0How ca= n
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. =A0Why 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. =A0They pay no attention t= o newlines, delimiters or anything else. =A0Just create the output file, th= en in a loop open the input files and loop through each (read doesn't n= ecessarily get the whole thing in one pass)

You'll spend lots more energy on the mechanics of finding the files the= n on the copying. =A0But perhaps the shutil module will have some further s= hortcuts.

--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list

You are right Dave, printf was= a blunder
=A0

--14dae9340b81a9e32904d626377b--