Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40160

Re: Read csv file and create a new file

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Neil Cerutti <neilc@norwich.edu>
Newsgroups comp.lang.python
Subject Re: Read csv file and create a new file
Date 28 Feb 2013 19:32:47 GMT
Organization Norwich University
Lines 43
Message-ID <ap9pmvFu2gjU1@mid.individual.net> (permalink)
References <512fac9c$0$40355$4fafbaef@reader1.news.tin.it>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace individual.net ISQiu+AgoYyTaGAbSAeGBwZV9V800XgA+17Wmr3nrOTCUg+sOFAhY11ytrdVOYdZ9R
Cancel-Lock sha1:BtuYoPlc/9IbnmyJCOh7PYuq/SM=
User-Agent slrn/0.9.9p1/mm/ao (Win32)
Xref csiph.com comp.lang.python:40160

Show key headers only | View raw


On 2013-02-28, io <maroso@libero.it> wrote:
> Hi,
>
> i have to files. 
>
> First file is a csv file
> Second file is a plain text file where each row has a value (text)
>
> I want to be able to create a third file using data from the first file 
> excluding the values listed in the second file.
>
> Example:
>
> First file:
> -----------
>
> mtgoxeur	12	24	36
> mtgoxusd	10	12	14
> mtgoxpln	2	4	6
>
>
> Second file:
> ------------
>
> mtgoxusd
>
>
>
> Third File (the resulting one) :
> --------------------------------
>
> mtgoxeur	12	24	36
> mtgoxpln	2	4	6
>
> Thanks to anyone that can help

You don't appear to need the csv module at all. You'll just need
the startswith string function.

For more help, please show us some code.

-- 
Neil Cerutti

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Read csv file and create a new file io <maroso@libero.it> - 2013-02-28 19:14 +0000
  Re: Read csv file and create a new file Neil Cerutti <neilc@norwich.edu> - 2013-02-28 19:32 +0000
  Re: Read csv file and create a new file Joel Goldstick <joel.goldstick@gmail.com> - 2013-02-28 14:34 -0500
  Re: Read csv file and create a new file Dave Angel <davea@davea.name> - 2013-02-28 14:35 -0500
  Re: Read csv file and create a new file io <maroso@libero.it> - 2013-02-28 19:51 +0000
    Re: Read csv file and create a new file Neil Cerutti <neilc@norwich.edu> - 2013-02-28 20:11 +0000
      Re: Read csv file and create a new file io <maroso@libero.it> - 2013-02-28 20:23 +0000
        Re: Read csv file and create a new file io <maroso@libero.it> - 2013-02-28 20:46 +0000
          Re: Read csv file and create a new file io <maroso@libero.it> - 2013-02-28 20:51 +0000
          Re: Read csv file and create a new file Dave Angel <davea@davea.name> - 2013-02-28 16:23 -0500
            Re: Read csv file and create a new file io <maroso@libero.it> - 2013-02-28 22:05 +0000
              Re: Read csv file and create a new file Dave Angel <davea@davea.name> - 2013-02-28 19:13 -0500
  Re: Read csv file and create a new file Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-28 21:04 -0500
    Re: Read csv file and create a new file io <maroso@libero.it> - 2013-03-04 19:04 +0000
      Re: Read csv file and create a new file Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-04 23:58 +0000

csiph-web