I am looking for the pattern #type
in a set of files. As output I should return the lines containing that pattern. The lines are organized as columns with tab separator:
<subject1> <#type> <object1>
<subject2> <#type> <object1>
<subject3> <#type> <object2>
<subject4> <#type> <object2>
<subject5> <#type> <object3>
For this purpose I am using the command ack-grep:
$ack-grep "#type"
I can also use sed as:
sed -n -e "/#type/p;q" *.nt
the problem is that the duplicates that I should avoid are the objects
. As output I should be having:
<subject1> <#type> <object1>
<subject3> <#type> <object2>
<subject5> <#type> <object3>