Mephi wrote:
Just prepend it to the field before printing them:
awk '{$25="100000000"$25; print}'
for example:
mak@yoda:~$ echo "a 1363231555 c d" | awk '{$2="100000000"$2; print}' a 1000000001363231555 c d
-- Martijn
Wow.
Thankyou :-)
Matt
-----Original Message----- From: Martijn Koster [mailto:mak-alug@greenhills.co.uk] Sent: 14 August 2009 19:29 To: Mephi Cc: main@lists.alug.org.uk Subject: Re: [ALUG] Really awkward text parsing shell script question
Mephi wrote:
I need to add a value to the 25th item in each line. Other than knowing
that value is
Just prepend it to the field before printing them:
awk '{$25="100000000"$25; print}'
for example:
mak@yoda:~$ echo "a 1363231555 c d" | awk '{$2="100000000"$2; print}' a 1000000001363231555 c d
-- Martijn