awk,sed, or lex question

awk,sed, or lex question

Post by Steve Barr » Thu, 09 Feb 1995 01:16:15



do any of the unix utilities change right/left justification of files?
I'd  like to copy a file and change one field from right to left justified.
Can't find anything in any of the manuals? Any guidance would be appreciated>
.
Thanks.
 
 
 

awk,sed, or lex question

Post by nschr.. » Fri, 10 Feb 1995 05:14:44



> do any of the unix utilities change right/left justification of files?
> I'd  like to copy a file and change one field from right to left justified.
> Can't find anything in any of the manuals? Any guidance would be appreciated>

You can do it with awk. Use the formatted printf() for your output and
you can control field justification with the formatting. Integers will
be left justified with %d right with %nd where n is the maximum width for
the field. Floats will go left with %.mf where m is the precision, right
with %n.m. Strings go left with %-ns right with %ns.

 
 
 

1. purpose of awk sed lex yacc

hi all,

i had to do a search and replace assignment and sed did it just fine for me.
(thanks to this ng as well)

please let me know as to when would one use lex yacc awk.

i am asking because these are tools and tools are for getting something ie
your assignment or work done efficiently. right ?? hence in this context
please let me know a typical application where one has used lex/
yacc/awk/sed
(for sed i just did a small job and realised how powerful it was)

thanks

2. KERNEL-COMPILE-GUIDE [6-30]

3. sed/awk - generating Makefiles (Re: awk processing of Makefile macros)

4. IDE performance on 164sx?

5. SED & AWK Question...

6. commonly used development tools

7. sed/awk question

8. Compaq LTE Elite 4/40cx, Slackware, and PCMCIA

9. Question to awk and sed

10. grep/awk/sed question

11. sed (awk?) question: how to replace by counter?

12. shell - sed - awk question

13. A question on Sed/Awk?