awk command to avoid loops

Hi...
I need a help in using the awk command or any other solution to avoid the usage of loops.

My question is :

I have a input like this :

 
field1|field2|field3|field4|field5|field6|field7|field8|field9
ex : 4000|testing|scenario|14450|500|320|450|200|100

where the 4th field i.e 14450 is a date field which will be passed to a converter which will automatically convert to the normal date format.

(eg : date_conv(14450) will give output 12/10/2009. )

Now i am looking for a solution which will get the output in the following manner.

o/p format :

 
4000|testing|scenario|12/10/2009|500|V(hexadecimal value of field6 ) - hexadecimal value of field7) - (field8*10) - field9

Note '-' represents hyphen.

So in my output there will be only 6 fields like :

 
4000|testing|scenario|12/10/2009|500|field6

where field 6 = v(hexadecimal value of field6 ) - hexadecimal value of field7) - (field8*10) - field9

In My input field6=320 then the hexadecimal value will be 140
if field7=450 then the hexadecimal value will be 1C2.

So my final output will be

 
4000|testing|scenario|12/10/2009|500|V140-1C2-2000-100

Please help..

Thanks.

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

I wouldn't trust any date conversion code that gave that as an output. Is it October 12 or December 10?

And what relation does 14450 have to either of those?

For conversion to hex, use printf "%x\n"