I have a names.txt file where each line is of the form:
xxxxxx random_string_of_characters 2015
where xxxxxx is a 6-digit number, and random_string_of_characters can be anything. I want to use the substitute command to replace all the empty space and the random_string_of_characters between xxxxxx and 2015 in each row, so that each string looks like this:
xxxxxx 2015
So, what would be the best way to accomplish this?
awk '{print $1,$3}'...$NFinstead of$3just to be sure as "random_string_of_characters can be anything"