-6

I have a file like this:

link to the file

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
jww
  • 97,681
  • 90
  • 411
  • 885
Afroboy23
  • 31
  • 9
  • 2
    also post some code, what did you try until now? – JavaSheriff Oct 29 '19 at 16:53
  • 1
    What have you tried? What exactly are you having problem with? Stackoverflow is a site for specific programming questions for programming enthusiasts, not a "do my job for me" service, you may want to try on some freelancing sites, where you actually offer some goods in exchange for a service. – KamilCuk Oct 29 '19 at 16:56
  • 1
    Also, a quick SO search would give you an example where you can move from. For example, your question is kinda answered here: https://stackoverflow.com/questions/4286469/how-to-parse-a-csv-file-in-bash/54361474 – Yiğit Aras Tunalı Oct 29 '19 at 16:57
  • ytf is this an img and not a `` block – Mika Feiler Oct 29 '19 at 17:02

1 Answers1

0

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
Ranganatha
  • 113
  • 4