I have a file with some lines of data that I want to extract. I'm thinking awk is a good fit for this. In pseudocode I'm imagining doing something like:Find match for line I want to process with awkIn the second part, inside the {} find a regex match for my data, maybe with grep -o?Print the match, maybe at the end inside the {} or inside and ENDI'm not sure how to go about doing this, I know I'm not using cut properly but I just showed it to give some idea of intent. Would love some help. Essentially I want to get my hands on the $0 and start extracting various regex matches so I can piece them together into my own CSV format.This is what I've tried:  tmp cat data.txtConcurrency Level:      1Time taken for tests:   0.004 secondsComplete requests:      1Failed requests:        0Total transferred:      838 bytesHTML transferred:       632 bytesRequests per second:    257.40 [#/sec] (mean)Time per request:       3.885 [ms] (mean)Time per request:       3.885 [ms] (mean, across all concurrent requests)Transfer rate:          210.65 [Kbytes/sec] received  tmp cat data.txt | awk '/Complete requests:/ {print;}'Complete requests:      1  tmp cat data.txt | awk '/Complete requests:/ {print $0;}'Complete requests:      1  tmp cat data.txt | awk '/Complete requests:/ {print;}'|cut -d: -f2      1I'm going for something likeTime taken for tests, 0.0004, s Requests per second (mean), 257.40, #/sec...Transfer rate received, 210.65, Kbytes/secBecause the data isn't very uniform that why I'm going to want to write a separate post-regex-match processing of $0 for each match /Concurrency Level:/, Time taken for tests:, etc     
How to process awk line matches?
awk;regular expression
You can have as many awk rule-action pairs as you like. Since you appear to want to re-order some of the sub-fields, you probably want a global rule that splits everything after the : into an array that you can manipulate later on a per-rule basis.For example (I've only shown the first two here):awk 'BEGIN {FS=:[ \t]+; OFS=, }{split($2, a, /[ \t]+/)}## now the case-by-case rule-action pairs/Time taken/ {print $1, a[1], a[2]}/Requests per second/ {print $1 a[3], a[1], substr(a[2], 2, length(a[2])-2)}' data.txtTime taken for tests, 0.004, secondsRequests per second (mean), 257.40, #/sec