format output bash
Greetings
i have a file which contains the following Something 01 average max min 123 215 0 Something 02 average max min 1 10 5 etc... im hoping to change the output to look like: Something 01 average 123 max 215 min 0 Something 02 average 1 max 10 min 5 help please Thank again. |
what have you tried and where are you stuck. i would use awk.
|
ditto for awk
|
this works but its pretty lame. more compact way?
awk '{print $1}' file > 1;awk '{print $2}' file >> 1;awk '{print $3}' file >> 1 |
This solution is written in a way which is intended to be instructive.
It could be done with fewer keystrokes but this is most readable. With this InFile ... Code:
Code:
awk '{n=NR%4; Code:
|
Quote:
Here is what I get running your suggestion: Code:
$ awk '{print $1}' file > 1;awk '{print $2}' file >> 1;awk '{print $3}' file >> 1 So before I can deliver a solution I need to know which output you are after? Also, are you really looking to make a file called '1'? |
All times are GMT -5. The time now is 05:26 PM. |