Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SaveAs comma delimited with double-quotes

4 posts in DataWindow Last posting was on 2009-09-14 18:13:16.0Z
Bablo Posted on 2009-09-09 20:27:23.0Z
Sender: 4766.4aa80ee3.1804289383@sybase.com
From: Bablo
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: SaveAs comma delimited with double-quotes
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4aa80fab.4788.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 9 Sep 2009 13:27:23 -0700
X-Trace: forums-1-dub 1252528043 10.22.241.41 (9 Sep 2009 13:27:23 -0700)
X-Original-Trace: 9 Sep 2009 13:27:23 -0700, 10.22.241.41
Lines: 14
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89935
Article PK: 419125

I'm trying to save the contents of a datawindow to a comma
delimited text file with double-quotes around the data.
However, when I put double-quotes around the data the
resulting file contains two double-quotes for each
double-quote that I've added.

"SDLFKSDFJLSDK" <- this is what I've entered into the
column.
""SDLFKSDFJLSDK"" <- this is what the value looks like in
the file when I open it up.

Hmmmm, can anyone help?
Thank-you,
Bablo


Jeremy Lakeman Posted on 2009-09-10 03:29:40.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: SaveAs comma delimited with double-quotes
Date: Wed, 9 Sep 2009 20:29:40 -0700 (PDT)
Organization: http://groups.google.com
Lines: 19
Message-ID: <88ed9d28-c58d-4138-b672-fcca2553de53@e18g2000vbe.googlegroups.com>
References: <4aa80fab.4788.1681692777@sybase.com>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1252553380 26603 127.0.0.1 (10 Sep 2009 03:29:40 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 10 Sep 2009 03:29:40 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e18g2000vbe.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!e18g2000vbe.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89936
Article PK: 419123


On Sep 10, 5:27 am, Bablo wrote:
> I'm trying to save the contents of a datawindow to a comma
> delimited text file with double-quotes around the data.
> However, when I put double-quotes around the data the
> resulting file contains two double-quotes for each
> double-quote that I've added.
>
> "SDLFKSDFJLSDK"    <- this is what I've entered into the
> column.
> ""SDLFKSDFJLSDK"" <- this is what the value looks like in
> the file when I open it up.
>
> Hmmmm, can anyone help?
> Thank-you,
> Bablo

The save as process only escapes string values that contain quotes or
comma's. If you want to quote everything regardless, I'd suggest
writing your own file writing process. But it will be slower.


Ivaylo Ivanov Posted on 2009-09-10 10:03:27.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4aa80fab.4788.1681692777@sybase.com>
Subject: Re: SaveAs comma delimited with double-quotes
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4aa8ceef@forums-1-dub>
Date: 10 Sep 2009 03:03:27 -0700
X-Trace: forums-1-dub 1252577007 10.22.241.152 (10 Sep 2009 03:03:27 -0700)
X-Original-Trace: 10 Sep 2009 03:03:27 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89937
Article PK: 419124

Instead of SaveAs() try SaveAsAscii() or SaveAsFormattedText().
They have additional parameters for delimiters and convertion of <CR><LF>
sequences

Regards,
Ivaylo

<Bablo> wrote in message news:4aa80fab.4788.1681692777@sybase.com...
> I'm trying to save the contents of a datawindow to a comma
> delimited text file with double-quotes around the data.
> However, when I put double-quotes around the data the
> resulting file contains two double-quotes for each
> double-quote that I've added.
>
> "SDLFKSDFJLSDK" <- this is what I've entered into the
> column.
> ""SDLFKSDFJLSDK"" <- this is what the value looks like in
> the file when I open it up.
>
> Hmmmm, can anyone help?
> Thank-you,
> Bablo


Craig Kazial Posted on 2009-09-14 18:13:16.0Z
Reply-To: "Craig Kazial" <ckazial@uniland.com>
From: "Craig Kazial" <ckazial@uniland.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4aa80fab.4788.1681692777@sybase.com>
Subject: Re: SaveAs comma delimited with double-quotes
Lines: 31
Organization: Uniland
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4aae87bc@forums-1-dub>
Date: 14 Sep 2009 11:13:16 -0700
X-Trace: forums-1-dub 1252951996 10.22.241.152 (14 Sep 2009 11:13:16 -0700)
X-Original-Trace: 14 Sep 2009 11:13:16 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89951
Article PK: 419139

You don't need to do your own escaping when you do a Save As CSV, generally.
So I'd try that first.

I originally was doing my own double-quoting for a field as well, but then
backed that out.

However I have just recently ran into an issue where I compile text data
together in one column, and write all the data rows out as a CSV with
headers. Every instance of it should require the complied text column being
enclosed in double quotes, but for some reason both in PB8 and PB11.5 I
have -one- instance of this not being the case. Makes automation of the
process a bit more difficult...! =b

<Bablo> wrote in message news:4aa80fab.4788.1681692777@sybase.com...
> I'm trying to save the contents of a datawindow to a comma
> delimited text file with double-quotes around the data.
> However, when I put double-quotes around the data the
> resulting file contains two double-quotes for each
> double-quote that I've added.
>
> "SDLFKSDFJLSDK" <- this is what I've entered into the
> column.
> ""SDLFKSDFJLSDK"" <- this is what the value looks like in
> the file when I open it up.
>
> Hmmmm, can anyone help?
> Thank-you,
> Bablo