I am having a large file which column one is in the following format. There can be 3-6 different id separated by "_"
s1_asd_ucsd
b4_asd_id_vu
c10_id_js_uw
d4_sch_vu
I want to split this column into two column. Column 2 contain the last id and column 1 contain the initial ids; like bellow
s1_asd ucsd
b4_asd_id vu
c10_id_js uw
d4_sch vu
I know how to print the last column by following; but dont know how to print the previous ids while keeping the separator.
awk '{n=split($1, b, "_"); }{ print b[n]}'