I have a text file separated by space as follows. I need to re-arrange the columns so that the first column is at the end of each line.I have an idea of how this could be done using cut -d' ' f1 but I'm wondering if there is an easy way with awk or sed.Text File:       trade mark       information..    left-right arrow..down-left arrow..    right arrow curving left..left arrow curving right..    watch..hourglass done       keyboard       eject button..    fast-forward button..hourglass not done..    pause button..record button       circled M..    black small square..white small square       play button       reverse buttonWant symbol list to follow description instead.
awk or sed, move first column to end?
text processing;awk;sed
Use sedsed 's/\([^ ]*\) *\(.*\)/\2 \1/' infileThis \([^ ]*\) will match everything until a non-space characters seen.The parentheses \(...\) is used to made a group matching which its index would be \1.The \(.*\) matches everything after first group and it's indexed \2.The  * in \(...\) *\(...\) out of matched groups will ignore to print in output which is matching spaces between group 1 and 2, you could use \s* (with GNU sed) or [[:space:]]* (standardly) instead to match any spacing characters instead of just ASCII SPC as well.Then at the end first we are printing matched group2 than group1 with a space between.