[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: COMMA DELIMITED FILES
- Subject: Re: COMMA DELIMITED FILES
- From: Arjan Hoornstra <ahoor@YAHOO.COM>
- Date: Thu, 24 Feb 2000 09:38:32 -0800
I would use the 'write' command rather than 'print'.
I wrote several programs that create a flat file, some
comma delimited. There always is the 'translate'
function for free format fields where an unaware user
can write a comma. Same problem with quotes and double
quotes. Also a semi colon sometimes doesn't work if a
user makes a typo (you'ld be surprised how many times
I see a ;l or l; where a l should be)
I would use a variable for the delimeter, maybe a few
variables if you need qutoes around char fields like
let $a = ',' ! for seperation of 2 integers
let $b = '","' ! for seperation of 2 chars
let $c = '",' ! for seperation of a char followed
by ! an integer
let $d = ',"' ! for seperation of an integer
! followed by a char
and the script would be something like
..
let $lastname = translate(&lastname,',','')
let $firstname = translate(&firstname,',','')
let $age = edit(#age,888)
write 1 from $id $d $lastname $b $firstname $c $age
..
You can concatenate the commas and quotes (if needed)
to the variables but for better maintanance I would do
it seperate.
Arjan
>
>
> > -----Original Message-----
> > From: Discussion of SQR, Brio Technology's
> database reporting language
> > [mailto:SQR-USERS@list.iex.net]On Behalf Of Julie
> Lawton
> > Sent: Thursday, February 24, 2000 6:22 AM
> > To: SQR-USERS@list.iex.net
> > Subject: COMMA DELIMITED FILES
> >
> >
> > Hi,
> >
> > This is probably a basic question for most of you
> but I am a very new user
> > to SQR.
> >
> > I am using SQR to generate flat files. I am
> selecting data from a Sybase
> > database. How can I generate the file so that the
> data items are comma
> > delimited? I can't find anything in the manuals
> about this.
> >
> > Thanks
> >
> > Julie
> >
>
______________________________________________________
> > Get Your Private, Free Email at
> http://www.hotmail.com
> >
>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com