I have a text file that contains:
toto.titi.any=val1 toto.tata.any=val2 toto.tete.any=val2
How to extract titi , tata
titi
tata
awk/cut would be better choice for this problem.
here is the sed line and grep option:
sed -r 's/.*\.([^.]*)\..*/\1/' grep -Po '\.\K[^.]*(?=\.)'