Question: Using the awk command in Unix. I need to manipulate raw data with course numbers and 9 digit employee numbers at the end like the

Using the awk command in Unix.

I need to manipulate raw data with course numbers and 9 digit employee numbers at the end like the following two examples.

Fall 2017 COMM 438T-01 21785 888972491

Summer 2017 MSW 571-40 11230 890248716

I'm trying to produce a listing which is grouped by season (fall and summer) and ordered by class number(the numbers around the dash) and then section number(the 5 digit number) in descending order. Then a count for the amount of Fall and Summer groups. I have the awk command and scripting as tools to do this.

****Each line that's output needs to be a line that has a 9 digit employee number included within it.

I try to use awk '/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/{print " "$0""$1""$2""$3" "$4" "$5""$6""$7""$8""$9}' a.txt | sort

but for some reason it seems to merge a couple lines together, i have lines that have 22 elements instead. Almost as if each line doubled in size and more.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!