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.

Regarding ImportString Function

3 posts in DataWindow Last posting was on 2008-05-26 00:01:26.0Z
Linto Thomas Posted on 2008-05-23 09:38:33.0Z
Sender: 111f.48368d33.1804289383@sybase.com
From: Linto Thomas
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Regarding ImportString Function
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48369099.1182.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 23 May 2008 02:38:33 -0700
X-Trace: forums-1-dub 1211535513 10.22.241.41 (23 May 2008 02:38:33 -0700)
X-Original-Trace: 23 May 2008 02:38:33 -0700, 10.22.241.41
Lines: 18
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86929
Article PK: 416186

EveryBody Knows that "ImportString Function Inserts data
into a DataWindow control or DataStore from tab-delimited
data in a string"
But I have a requirement, which is little different.

I want to move a file line into a single column.(ie
irrespective of the tab character present in the line)..
and next line of file should move to next row..

In Shot, I want to move a file into ONE column datawindow..

I got 2 solution which introduce lot overhead..

I will be tankful for the one who comeup with best solution
..

Regards
Linto Thomas


Brad Wery[TeamSybase] Posted on 2008-05-23 13:49:53.0Z
From: "Brad Wery[TeamSybase]" <bradweryatgmail.com>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Regarding ImportString Function
References: <48369099.1182.1681692777@sybase.com>
In-Reply-To: <48369099.1182.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4836cb81$1@forums-1-dub>
Date: 23 May 2008 06:49:53 -0700
X-Trace: forums-1-dub 1211550593 10.22.241.152 (23 May 2008 06:49:53 -0700)
X-Original-Trace: 23 May 2008 06:49:53 -0700, vip152.sybase.com
Lines: 51
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86933
Article PK: 416189

How about using the File functions to read the file and insert the data.
Something like this:

ll_file = FileOpen(<file>, LineMode!...)

DO WHILE FileRead(ll_file, ls_data) > 0
ll_row = dw_1.InsertRow(0)
dw_1.SetItem(1, ll_row, ls_data)
LOOP

FileClose(ll_file)


I'm not sure how well that would perform.

Brad

Linto Thomas wrote:
> EveryBody Knows that "ImportString Function Inserts data
> into a DataWindow control or DataStore from tab-delimited
> data in a string"
> But I have a requirement, which is little different.
>
> I want to move a file line into a single column.(ie
> irrespective of the tab character present in the line)..
> and next line of file should move to next row..
>
> In Shot, I want to move a file into ONE column datawindow..
>
> I got 2 solution which introduce lot overhead..
>
> I will be tankful for the one who comeup with best solution
> ..
>
> Regards
> Linto Thomas

--

*********************************************************************************
www.PowerToTheBuilder.com

- Free, full featured database development tool for ASE and SQL Server
- Take control of your GUI with a free PB user control library
- Get updates from by blog - www.PowerToTheBuilder.com/blog

*********************************************************************************
Submit a PowerBuilder Success Story
www.PowerToTheBuilder.com/success.aspx

*********************************************************************************


Jeremy Lakeman Posted on 2008-05-26 00:01:26.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Regarding ImportString Function
Date: Sun, 25 May 2008 17:01:26 -0700 (PDT)
Organization: http://groups.google.com
Lines: 35
Message-ID: <da831c8e-3772-47a6-aecd-3214c5282350@x35g2000hsb.googlegroups.com>
References: <48369099.1182.1681692777@sybase.com> <4836cb81$1@forums-1-dub>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1211760086 19439 127.0.0.1 (26 May 2008 00:01:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 26 May 2008 00:01:26 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: x35g2000hsb.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 asp.essential.intranet:3128 (squid/2.5.STABLE8)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!x35g2000hsb.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86952
Article PK: 416209

This is probably faster;

ll_file = FileOpen(<file>, linemode!, ...)

do while fileread(ll_file, ls_line)
ll_line++
lsa_contents[ll_line]=ls_line
loop

FileClose(ll_file)

if ll_line > 0 then
dw_1.object.column.primary=lsa_contents
end if

On May 23, 10:49 pm, "Brad Wery[TeamSybase]" <bradweryatgmail.com>

wrote:
> How about using the File functions to read the file and insert the data.
> Something like this:
>
> ll_file = FileOpen(<file>, LineMode!...)
>
> DO WHILE FileRead(ll_file, ls_data) > 0
> ll_row = dw_1.InsertRow(0)
> dw_1.SetItem(1, ll_row, ls_data)
> LOOP
>
> FileClose(ll_file)
>
> I'm not sure how well that would perform.
>
> Brad
>
>
>