I’m trying to us the gawk command in Cygwin on Windows XP and I’m having a little trouble getting the exact results that I want. I was hoping I could get a little help. I’m searching for just POWERTRAIN CONTROL MODULE and I’m getting that and several other lines as well. I would like to get the row with just POWERTRAIN CONTROL MODULE in it. The information below is the command that I’m using and the results that I got.
gawk ‘/POWERTRAIN CONTROL MODULE/ {print $0}’ trans.txt>>output.txt
The following are the results that I’m getting:
4283 POWERTRAIN CONTROL MODULE
4284 POWERTRAIN CONTROL MODULE (DIESEL)
4285 POWERTRAIN CONTROL MODULE - C1
4286 POWERTRAIN CONTROL MODULE - C2
4287 POWERTRAIN CONTROL MODULE - C3
4288 POWERTRAIN CONTROL MODULE - C4
4289 POWERTRAIN CONTROL MODULE-C1
4290 POWERTRAIN CONTROL MODULE-C2
7308 POWERTRAIN CONTROL MODULE C1
8824 POWERTRAIN CONTROL MODULE RELAY CONTROL
8825 POWERTRAIN CONTROL MODULE RELAY OUTPUT
All I want is the first line (4283 POWERTRAIN CONTROL MODULE) and nothing else. If somebody could help, it would be greatly appreciated.
Thanks in advance.
gawk ‘/POWERTRAIN CONTROL MODULE/ {print $0}’ trans.txt>>output.txt
The following are the results that I’m getting:
4283 POWERTRAIN CONTROL MODULE
4284 POWERTRAIN CONTROL MODULE (DIESEL)
4285 POWERTRAIN CONTROL MODULE - C1
4286 POWERTRAIN CONTROL MODULE - C2
4287 POWERTRAIN CONTROL MODULE - C3
4288 POWERTRAIN CONTROL MODULE - C4
4289 POWERTRAIN CONTROL MODULE-C1
4290 POWERTRAIN CONTROL MODULE-C2
7308 POWERTRAIN CONTROL MODULE C1
8824 POWERTRAIN CONTROL MODULE RELAY CONTROL
8825 POWERTRAIN CONTROL MODULE RELAY OUTPUT
All I want is the first line (4283 POWERTRAIN CONTROL MODULE) and nothing else. If somebody could help, it would be greatly appreciated.
Thanks in advance.