Mar 23, 2004 #1 stevof Technical User Joined Jun 22, 2003 Messages 31 Location CZ hi, i've got a file which consists of <number1><number2>string <number3><number4>string . . . how can i create a new file where both of numbers'll be decreased by 500? <number1-500><number2-500>string <number3-500><number4-500>string . . . thanx a lot!
hi, i've got a file which consists of <number1><number2>string <number3><number4>string . . . how can i create a new file where both of numbers'll be decreased by 500? <number1-500><number2-500>string <number3-500><number4-500>string . . . thanx a lot!
Mar 23, 2004 #2 Salem Programmer Joined Apr 29, 2003 Messages 2,455 Location GB Try this Code: awk '{ $1 = $1 - 500 ; $2 = $2 - 500 ; print }' file -- Upvote 0 Downvote
Mar 23, 2004 #3 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR Try something like this: nawk -F'[<>]' ' {print "<"$2-500"><"$4-500">"$5} ' /path/to/file Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 Upvote 0 Downvote
Try something like this: nawk -F'[<>]' ' {print "<"$2-500"><"$4-500">"$5} ' /path/to/file Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884