I need to get a specific string from a bigger string:
From these Abcd1234_Tot9012_tore.dr
or Abcd1234_Tot9012.tore.dr
I want to get those numbers which are between Tot
and _
or .
, so I should get 9012
. Important thing is that the number of characters before and after these numbers may vary.
Could anyone give me a nice solution for this? Thanks in advance!
Using
grep
you can do:OUTPUT: