by Ted Davis <tdavis@[EMAIL PROTECTED]
>
Mar 2, 2008 at 11:22 AM
On Sun, 02 Mar 2008 08:39:46 -0800, happytoday wrote:
> I am accepting a value entered from batch file using set /p command. I
> need to add spaces to the left of the number entered inside an awk
script
>
> nawk -v number=%number% -f test.awk test.dat
>
>
> What function used to fill the left side of the number with spaces to
> complete 7 characters as fixed length of any nymber entered. Thanks
You might like gawk better:
<http://gnuwin32.sourceforge.net/packages/gawk.htm>
The Windows version has a .hlp help file with lots of information.
You need printf() or sprintf(), depending on what you do with the padded
number.
printf "%7i", number
Note that you have to include a \n explicitly at the end of each line.
--
T.E.D. (tdavis@[EMAIL PROTECTED]
) MST (Missouri University of Science and
Technology)
used to be UMR (University of Missouri - Rolla).