I have a file like this:
I want to get the school section of the file and place it into a new file.
The output in the new file should be like this:
School
Texas high,SA high,Plano tech
The following awk script should solve your probelm provided you manually add the School
heading yourself or if that remains same add it as BEGIN { printf "School" }
in below example.
$ cat input_file
Mark,Texas High, Dallas, k-5
Steve,SA high,Antonio,k-5
Adam,Plano tech,k-5
$ awk -F, 'BEGIN { sep = ""} { printf("%s%s", sep, $2); sep = ","}' < input_file
Texas High,SA high,Plano tech
` block
– Mika Feiler Oct 29 '19 at 17:02