I am new to these awk and shell things and got stuck with a simple but logical issue ..
Input File:
6000 9876 5675 ....
8576 8765 9845 ...
....
Output File: (required)
60 00 98 76 56 75 ....
85 76 87 65 98 45 ...
....
Converting output to input is a rather easy task
awk '{printf("%s%s %s%s %s%s %s%s", $1, $2, $3, $4, $5, $6, $7, $8)}' output_file
> input_file
But converting input to output I am getting no guess
(also no. of fields are not known in advance although I think some logic with NF can solve this issue) but main problem is even if I know no. of fileds then how to proceed for that??
The min. unit to be read wll be like $1,$2 etc.. and I need to break them and need to insert a space between them.
I don’t know much about regex but trying my hand on it.May be some manipulation with sed and regex could help me out.
Please provide your valuable suggestons.`
Alternatively to avoid the first tr: