I have a text file that is structure like below :
293.0 2305.3 1508.0
2466.3 1493.0
2669.5 1578.6
3497.2 1768.9
4265.5 2092.4
5940.8 2558.6
7308.7 3015.4
9377.7 3814.6
295.0 2331.4 1498.1
3617.0 1893.2
I'm still new in Linux, is there anyway for it to be output as desire like an example below :
293.0 2305.3 1508.0
293.0 2466.3 1493.0
293.0 2669.5 1578.6
293.0 3497.2 1768.9
293.0 4265.5 2092.4
293.0 5940.8 2558.6
293.0 7308.7 3015.4
293.0 9377.7 3814.6
295.0 2331.4 1498.1
295.0 3617.0 1893.2
So basically, I want it to duplicate until it meets another variable.
awk. Save the first field in a variable. If the current row only has 2 fields, print the variable followed by the fields in the row.