Try printf.  This example would give you just the first 3 characters of
field 6 as your example intended:

awk -F ';' '{ printf( "%.3s", $6) }'

You've also got lots of options for controlling numbers if the fields are
numeric only...

http://en.wikibooks.org/wiki/An_Awk_Primer/Output_with_print_and_printf

-HP


On Tue, Nov 19, 2013 at 5:23 PM, <canito at dalan.us> wrote:

> Actually it could be any command that will work with an old version of HP
> UX, but peferably awk.
>
> I have a text file with multiple fields seperated by a semicolon. For the
> nth field, I need to delete any number after the 3rd character.
>
> I've come up with this line but it won't work since it isn't a fixed
> length.
>
> awk -F";" '{gsub("...$","",$6);print}'
>
> I feel that I am close to finding the solution, but need a bit of help.
>
> (Sorry freakzilla, the message was meant for the list.)
>
> Thanks in advanced,
> Saul David Alanis
>
>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20131119/757b5369/attachment.html>