Hi.

On Tue, Oct 02, 2001 at 01:43:48PM +0800, [EMAIL PROTECTED] wrote:
> > because a newline will indicate a new record, new lines
> > have to be escaped. Else, you couldn't reasonably distinguish what's
> > content and what's record seperator.
> 
> Thanks for the reply. Seems to me mySQL should give me the \n I'm asking
> for rather than assuming that's not what I mean and escaping it so I
> don't get confused.

IMHO, no. It may not intuitive at first, but it is really what one
wants for default. For example, how would you else know, whether

test
asdf

was originally one row ("test\nasdf") or two rows ("test"+"asdf")?

If you want to control the output the hard way, you may want to
consider using SELECT ... INTO OUTFILE if feasible.

Or at mysqldump --tab (I never used that, so it may not fit).

> Is there some other way to produce this character, without the -t
> option?

AFAIK, not with mysql (the command line client), but see above. Or
else, convert the result afterwards:

mysql -B -N yasg -e "select 'asdf\ntest\ntest'" | awk 'BEGIN {RS="\\\\n"} {print $1}'

(there may be a better method with sed or something)

Bye,

        Benjamin.


-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to