I want to put values to a fix position (starting at same point) of a file as:
123 dene 2312 234234 44
3 dene 22 23422342334 4
$1 must start at 0th position of line
$2 must start at 19th position of line
$3 must start at 39th position of line
$4 must start at 50th position of line
I'm confused. You awk program prints 3 values (and not the first three of the five you say are being output) and you give output column positions for 4 values.
Please give us a clear example explaining which fields you want selected from your sample input lines and show us what the output should actually look like. Please use code tags when you post your input file contents, code segments, and expected output examples.
After seeing bipinajith's proposal, I had considered this too. Note that in the 1st posting, the last output field comes from $12, not $10. I had come up with:
but was waiting for bahadiraktan to respond to determine what value should be used instead of the 20 I have shown in red above. I had 19 for the first field's width instead of the 18 you used because bahadiraktan was specifying the 1st output column as #0 instead of the usual #1.