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


Groups > comp.lang.python > #25699

Re: Odd csv column-name truncation with only one column

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'ascii': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '"new': 0.16; '(file': 0.16; 'csv': 0.16; 'equivalents': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'separator,': 0.16; 'terms).': 0.16; 'detect': 0.17; '(in': 0.18; 'sort': 0.21; 'recognize': 0.22; 'changes,': 0.23; 'header': 0.24; "we'd": 0.24; 'creating': 0.26; 'expand': 0.26; 'guess': 0.27; 'header:X-Complaints-To:1': 0.28; 'represent': 0.28; 'record': 0.28; 'maybe': 0.29; 'fri,': 0.30; 'expect': 0.31; 'structure': 0.32; 'could': 0.32; '+0200,': 0.33; 'url:home': 0.33; 'to:addr :python-list': 0.33; 'excel': 0.33; 'there': 0.35; 'received:org': 0.36; 'method': 0.36; 'subject:with': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'two': 0.37; '(for': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'course.': 0.62; 'incorporate': 0.65; 'jul': 0.65; 'dialect': 0.84; 'dennis': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Odd csv column-name truncation with only one column
Date Fri, 20 Jul 2012 14:09:13 -0400
Organization > Bestiaria Support Staff <
References <mailman.2297.1342696862.4697.python-list@python.org> <5008110d$0$6865$e4fe514c@news2.news.xs4all.nl> <50084B81.50909@tim.thechases.com> <mailman.2318.1342732212.4697.python-list@python.org> <50098e6c$0$6880$e4fe514c@news2.news.xs4all.nl>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-76-253-104-34.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 3.3/32.846
X-No-Archive YES
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2350.1342807755.4697.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1342807755 news.xs4all.nl 6983 [2001:888:2000:d::a6]:54268
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25699

Show key headers only | View raw


On Fri, 20 Jul 2012 18:59:24 +0200, Hans Mulder <hansmu@xs4all.nl>
declaimed the following in gmane.comp.python.general:


> The sniffer will always guess '\r\n' as the line terminator.
> 
> That should not stop you from creating a dialect with '\x1E' as
> the line terminator.  Just don't expect the sniffer to recognize
> that dialect.
>
	{devil's advocate}: Maybe it's time to expand the CSV module... Of
course, if we set it to recognize x1E as a record separator, we should
be fair and also incorporate the other two ASCII "separator" codes. 

	x1D (group separator) could be used to signal a "new table" -- ie; a
change in record structure (number of columns, header labels). And then
x1C (file separator) could represent a new "worksheet" (in Excel terms).

	We'd need some sort of flag/query method to detect these changes, of
course.

	while not csv.EndOfSheet():
		while not csv.EndOfTable():
			...

	And then there is the potential of using <VT> and <FF> as
equivalents for x1D and x1C (for those files using <TAB> and <CR><LF> as
field/record separators).

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


Thread

Odd csv column-name truncation with only one column Tim Chase <python.list@tim.thechases.com> - 2012-07-19 06:21 -0500
  Re: Odd csv column-name truncation with only one column Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-19 12:08 +0000
  Re: Odd csv column-name truncation with only one column Hans Mulder <hansmu@xs4all.nl> - 2012-07-19 15:52 +0200
    Re: Odd csv column-name truncation with only one column Tim Chase <python.list@tim.thechases.com> - 2012-07-19 13:01 -0500
    Re: Odd csv column-name truncation with only one column Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-19 17:10 -0400
      Re: Odd csv column-name truncation with only one column Hans Mulder <hansmu@xs4all.nl> - 2012-07-20 18:59 +0200
        Re: Odd csv column-name truncation with only one column Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-20 14:09 -0400
    Re: Odd csv column-name truncation with only one column Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-20 08:31 +0000

csiph-web