Thu, Sep 30 2004
13:00:14
|
|
Request created by guest
|
|
Subject: [5.7] v.in.ascii support for Mac OS9 and DOS newlines
Platform: GNU/Linux/i386
grass obtained from: Mirror of Trento site
grass binary for platform: Compiled from Sources
GRASS Version: 5.7 cvs sept 2004
It would be nice if 5.7's v.in.ascii input from stdin supported Mac OS9 and DOS
newlines as well as UNIX ones. Just tried using it with a tab delimited text
file created in Win2k Excel on a OSX installation of GRASS; MS IE on OSX saved
the attachment as a Mac OS9 text file (argh), Safari saved it in original DOS
format... the conversion is not exactly something I could explain to the student
who only knew about Macs...
complication I had implementing this in 5.3's s.in.ascii: fgetl() doesn't stop
on \r's (Mac OS/9); I think v.in.ascii figures out input line length and uses
fgets(,maxlength), so this might not be an issue here.
For DOS files you need to strip the \r from the end of the line if it exists
otherwise it shows up in the last (text) field.
Hamish
|
|
Thu, Sep 30 2004
20:48:01
|
|
Mail sent by glynn.clements@virgin.net
|
|
Return-Path |
<glynn.clements@virgin.net>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
From |
Glynn Clements <glynn.clements@virgin.net>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Transfer-Encoding |
7bit
|
Message-ID |
<16732.18878.614396.451757@cerise.nosuchdomain.co.uk>
|
Date |
Thu, 30 Sep 2004 19:00:30 +0100
|
To |
Request Tracker <grass-bugs@intevation.de>
|
Cc |
grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #2641] (grass) [5.7] v.in.ascii support for Mac OS9 and DOS newlines
|
In-Reply-To |
<20040930110014.A8EC8102C13@lists.intevation.de>
|
References |
<20040930110014.A8EC8102C13@lists.intevation.de>
|
X-Mailer |
VM 7.07 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=2641
> -------------------------------------------------------------------------
>
> Subject: [5.7] v.in.ascii support for Mac OS9 and DOS newlines
>
> Platform: GNU/Linux/i386
> grass obtained from: Mirror of Trento site
> grass binary for platform: Compiled from Sources
> GRASS Version: 5.7 cvs sept 2004
>
> It would be nice if 5.7's v.in.ascii input from stdin supported Mac
> OS9 and DOS newlines as well as UNIX ones. Just tried using it with a
> tab delimited text file created in Win2k Excel on a OSX installation
> of GRASS; MS IE on OSX saved the attachment as a Mac OS9 text file
> (argh), Safari saved it in original DOS format... the conversion is
> not exactly something I could explain to the student who only knew
> about Macs...
>
> complication I had implementing this in 5.3's s.in.ascii: fgetl()
> doesn't stop on \r's (Mac OS/9);
What is fgetl()? Or did you mean G_getl()?
> I think v.in.ascii figures out input
> line length and uses fgets(,maxlength), so this might not be an issue
> here.
fgets() also stops on \n (G_getl() just calls fgets() and removes the
terminating NUL), so the same issue applies there.
> For DOS files you need to strip the \r from the end of the line if it
> exists otherwise it shows up in the last (text) field.
Yep.
The only thing which will work with Mac text files is avoiding the use
of fgets() altogether. There are currently around 250 files which use
fgets(), so this isn't a trivial change.
--
Glynn Clements <glynn.clements@virgin.net>
|
|
Fri, Oct 1 2004
01:37:02
|
|
Mail sent by hamish_nospam@yahoo.com
|
|
Return-Path |
<hamish_nospam@yahoo.com>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
Date |
Fri, 1 Oct 2004 11:36:52 +1200
|
From |
Hamish <hamish_nospam@yahoo.com>
|
To |
Glynn Clements via RT <grass-bugs@intevation.de>
|
Subject |
Re: [bug #2641] (grass) [5.7] v.in.ascii support for Mac OS9 and DOS newlines
|
Message-Id |
<20041001113652.6007cfc9.hamish_nospam@yahoo.com>
|
In-Reply-To |
<20040930184801.C1261102C2F@lists.intevation.de>
|
References |
<20040930184801.C1261102C2F@lists.intevation.de>
|
X-Mailer |
Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-pc-linux-gnu)
|
X-Face |
M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
|
Mime-Version |
1.0
|
Content-Type |
text/plain; charset=US-ASCII
|
Content-Transfer-Encoding |
7bit
|
X-Spam-Status |
No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
|
X-Spam-Level |
|
> > complication I had implementing this in 5.3's s.in.ascii: fgetl()
> > doesn't stop on \r's (Mac OS/9);
>
> What is fgetl()? Or did you mean G_getl()?
oh sorry, I'm confusing my Matlab and glibc commands.
(in Matlab fgetl() is fgets() but strips off the \n while fgets() doesn't)
> The only thing which will work with Mac text files is avoiding the use
> of fgets() altogether. There are currently around 250 files which use
> fgets(), so this isn't a trivial change.
which is why for s.in.ascii I had it G_fatal_error() if it found a Mac
OS9 file..
Hamish
|
|
Wed, Oct 20 2004
12:38:33
|
|
Comments added by guest
|
|
|
Fri, Oct 22 2004
06:54:15
|
|
Status changed to resolved by hbowman
|
|