in reply to extracting value in a string after checking value after colon ':'
Hi t-rex
While there’s not much more value to be added beyond Athanasius’ response; (assuming your data resides in "file.txt") here's the obligatory one-liner:
perl -lwne "print $1 if /(\d+)\s+cpus:\s*$/" file.txt
Best of luck
Shadowsong
|
---|
In Section
Seekers of Perl Wisdom