[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] Read a file into sqr
- Subject: Re: [sqr-users] Read a file into sqr
- From: "George Jansen" <GJANSEN@aflcio.org>
- Date: Wed, 04 Jan 2006 12:34:23 -0500
- Delivery-date: Wed, 04 Jan 2006 12:36:53 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
The alternative would be to use some other tool, e.g. Perl. For example, using
"z" as the delimiter for convenience, you could
/tmp>echo 'AAAAAAAAAAAAAAzBBBBBBBBBBBBBzCCCCCCCCCCCz' > stuff.txt
/tmp>perl -e '$/ = "z"; while(<>) { chop; print $_, "\n";}' stuff.txt
AAAAAAAAAAAAAA
BBBBBBBBBBBBB
CCCCCCCCCCC
>>> robert.goshko@gmail.com 01/04/06 11:18 AM >>>
On 03/01/06, Debbie Larney <debbie.larney@thicare.com> wrote:
> I have a text file that I am reading in through sqr. The file has no carriage
>returns or line breaks so the file wraps around. The end of a line appears to
>be delineated by a non ascii character so I can identify the end of a line. I
>think I need to in essence do a find and replace on the non ascii character so
>that I can replace it with a line break and read the file line by line into
>the sqr. Anyone have sample code or ideas doing a find and replace within sqr.
> Do I have to first read the entire file into a string and then do the find
>and replace. If so what are the limitations with this method.
It is probably a UNIX based file, they just have a line feed (0x0a)
character and look like one big long line in Notepad, PC based files
have a carriage return and line feed (0x0d 0x0a) at the end of each
line.
SQR parses files by looking for a "newline" which is either of the
combinations so it will read the file fine.
--
...Rob
-- No trees were killed in the sending of this message. However a
large number of electrons were terribly inconvenienced.
================================================
Robert Goshko
Registered Linux User #260513
Want a Gmail account, 2.6+ GB web mail (for free), just ask me.
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users