Sed: get lines starting with "RIM-COD-"

I have a Blackberry jad file:

RIM-COD-URL-12: HelloWorld-12.cod RIM-COD-Size: 68020 RIM-MIDlet-Icon-2-1: ____HOVER_ICON_res/icon/blackberry/icon-68.png,focused RIM-COD-URL-11: HelloWorld-11.cod RIM-MIDlet-Icon-Count-2: 1 RIM-COD-URL-10: HelloWorld-10.cod RIM-MIDlet-Icon-Count-1: 1 MIDlet-Vendor: Vasia Pupkin RIM-MIDlet-Icon-1-1: res\icon\blackberry\____HOVER_ICON_icon-68.png,focused Manifest-Version: 1.0 RIM-MIDlet-Flags-1: 0 RIM-COD-SHA1-38: 9a c8 b3 35 72 de 34 5e 7a 0a 5b 9e c3 3a 65 4c 20 0f 8e 50 

I just want the lines to start with RIM-COD- .

Can you provide me solutions for awk or sed ?

+7
source share
2 answers

Use sed -n and print only lines matching RIM-COD.

 sed -n -e '/^RIM-COD-/p' yourfile.txt 
+14
source

Try to do this:

 awk '/^RIM-COD/' file.txt 

Or

 grep "^RIM-COD" file.txt 

or

 sed -n '/^RIM-COD/p' file.txt 
+16
source

All Articles