in reply to Print text on the same line after match
You can use capturing parentheses and print the captured number ($1) instead of the entire line:
perl -ne 'print $1 if /INC\*XX\*(\d+)/' cr835.txt 123456
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Print text on the same line after match
by periodicalcoder (Novice) on Dec 14, 2018 at 22:48 UTC | |
by haukex (Archbishop) on Dec 14, 2018 at 23:08 UTC |
In Section
Seekers of Perl Wisdom