Need some Help in extracting data from a list
I have this list
(
("cable01" "M1" "E1")
("cable02" "M1" "E2")
("cable03" "M1" "E3")
("cable04" "E1" "M4")
("cable05" "E2" "M5")
("cable06" "E2" "M1")
)
So How to extract cable# (first item in list ) if I asked for cable which connected to a machine E1
And sort if there is more than one cable.
For example I asked for E1
The lisp filter cables number in Mtext in raws (even in second or third item)
cable01, M1
cable04, M4
For example I asked for M1
cable01, E1
cable02, E2
cable06, E2
cable03, E3
Thanks in advance