I am trying to search two strings in any two consecutive lines and need help.
Two search strings are "Airport" and "Rate" and sample Input file is described below :
Content of Input file :
1. Airport
2. Rate
3. Some text
4. Some more text
5. Airport
6. Some text
Desired Output :
1. Airport
2. Rate
P.S. Airport keyword in 5. is not in desired output since 4. and 6. doesn't have Rate keyword.
This is how I have get it so far :
PS> get-content "c:\Inputfile.txt" | select-string "Airport" -context 1 | s
elect-string "Rate" > c:\airportrate.txt
Thanks.