I think you want to use the a as a state variable, and act according to its state.
First, it must be 6\.4 in a regular expression, because an unescaped dot means "any character".
The action is missing.
If it's to append the current line, then it could be
awk 'a{buf=(buf FS $0)} /Module State/{a=1; buf=$0} /6\.4/{a=0; print buf}' FILE.csv
I use a buf variable:
- if
a == 1then add the current line tobufwith a leading space (append) - if
Module Stateis met then setato1and store the line inbuf - if
6.4is met then setato0and printbuf
In this case it's doable without buffering:
awk 'a{printf " %s", $0} /Module State/{a=1; printf "%s", $0} /6\.4/{a=0; printf "\n"}' FILE.csv
- if
a == 1then print the current line with a leading space and no ending newline (append) - if
Module Stateis met then setato1and print the current line without a newline - if
6.4is met then setato0and print an ending newline
I see opening and closing quotes, so maybe you just need my tip