I have a file with many lines which contain strings like [46ms] [986976ms] .. etc.
But with no rule regarding field separators or anything else.
I want to print ONLY THE STRING from each line , not the entire line !!!
For example from the lines :
Flow [login] on service [credentialService] executed with success in [46ms]. Performances are []
[] Flow [login] on service [exposerService] executed with success in [6406ms]. Performances are []
Flow [logout] on [service] [credentialService] executed with error in [34512ms]. Performances are [] and []
I want to have the output :
[46ms]
[6406ms]
[34512ms]
Or even better only the numbers from each of these strings. I want it with awk because I need speed, I have very big files to work with.
Hello, yes it is what I wanted. Just one more little thing. Is it possible to print only the digits from each of the matched strings ? I mean without square brackets and the word "ms" ?
I know I can extract them with a sed afterwards or something else, but I think your awk snippet can provide that directly.