>Your syntax error is that sprintf "prints" to a string buffer, not a file.
>Now, p'rhaps he wants fprintf, 'e does, Precious
It is interesting how sprintf() >> "filename" has been working all the
years. Probably for the wrong reason.
MB
--
e-mail: [EMAIL PROTECTED]
>I dont have my GAWK manual handy, but I think your problem may
>be that you are using SPRINTF which is a print to string function
>as in str = sprintf() rather than something like fprintf() or printf()
Not using gawk, using the original awk. Don't know if the original awk even
supports fprintf
> From: Vidiot <[EMAIL PROTECTED]>
> Date: Wed, 11 Jun 2003 11:17:14 -0500 (CDT)
>
> In all my years of using awk, this is the first time I've ever had to
> output a " character to a file. For example, I have the following:
>
> sprintf("%s,%s\n", SiteVal, CustomerID) >> "outputfile"
> I ne
ED] Behalf Of Vidiot
> Sent: Wednesday, June 11, 2003 1:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Simple AWK question
>
>
> >I suppose you could try
> >sprintf("%c%s%c,%c%s%c\n", '"', SiteVal, '"', '"',
>
On 11-Jun-2003/11:17 -0500, Vidiot <[EMAIL PROTECTED]> wrote:
>In all my years of using awk, this is the first time I've ever had to output
>a " character to a file. For example, I have the following:
>
> sprintf("%s,%s\n", SiteVal, CustomerID) >> "outputfile"
>
>
>I need the line in the out
Try using sprintf("%c", 042 ) and whatever else you need to complete
this.
> In all my years of using awk, this is the first time I've ever had to
> output
> a " character to a file. For example, I have the following:
>
> sprintf("%s,%s\n", SiteVal, CustomerID) >> "outputfile"
>
>
> I
>I suppose you could try
> sprintf("%c%s%c,%c%s%c\n", '"', SiteVal, '"', '"', CustomerID, '"') >>
>"outputfile"
awk: syntax error near line 13
awk: illegal statement near line 13
awk: newline in string near line 13
It is definatly baffling.
MB
--
e-mail: [EMAIL PROTECTED]
>
> In all my years of using awk, this is the first time I've
> ever had to output
> a " character to a file. For example, I have the following:
>
> sprintf("%s,%s\n", SiteVal, CustomerID) >> "outputfile"
I suppose you could try
sprintf("%c%s%c,%c%s%c\n", '"', SiteVal, '"', '"',
Have you tried using three " in a row. For example,
"""SiteVal""","""CustomerID"""
On Wed, 2003-06-11 at 12:17, Vidiot wrote:
> In all my years of using awk, this is the first time I've ever had to output
> a " character to a file. For example, I have the following:
>
> sprintf("%s,%s\n",