I have a fixedwidth file of length 3000. Now i want to copy a column of 4 chars i.e( length 1678-1681) to column 1127 � 1171 to the same file.
Please let me know how can i achive using a single command in fixed width file.
Also source column length is 4 chars and target column length is 45 chars.
So while coying the column the value should be left adjusted to the column.
Not sure if all systems / awk versions will support that large numbers which might be well beyond LINE_MAX (check with getconf LINE_MAX -> 2048 ). I didn't test this one with looong lines, you may try yourself:
It replaces 4 chars at the "to" location with the chars "back" earlier... In your request, "to" would be 1127, and "back" were -551 ... you may want to play around with the signs and operators...
But in the original file when i press end it is showing as 3001 but in the new generated file it is showing as 3002. Please let me know what could be the reason.