Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table

Status
Not open for further replies.

krava

Programmer
Jun 4, 2007
48
YU
Hi,

How to delete everything and keep just numbers in this table?

xl_1=1.14653 xr_1=1.24653 yl_1=4.14801 yr_1=5.64801
xl_2=1.14653 xr_2=1.24653 yl_2=5.64801 yr_2=7.14801
xl_3=1.24653 xr_3=1.34653 yl_3=3.07031 yr_3=4.57031
xl_4=1.24653 xr_4=1.34653 yl_4=4.57031 yr_4=6.07031
xl_5=1.34653 xr_5=1.44653 yl_5=2.01758 yr_5=3.51758

peca
 
Hi

To do exactly what you asked for :
Code:
awk '{gsub(/[^0-9]/,"")}1' /input/file
To do what probably you want :
Code:
awk '{for(i=1;i<=NF;i++)sub(/.*=/,"",$i)}1' /input/file

Feherke.
 
IMHO, sed is more suited:
Code:
sed 's![^ .0-9]*!!g' /path/to/input > outpout

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
sed can still a good alternative if the pattern stays consistent.

sed 's/[a-z]\{2,\}_[0-9]\{1,\}=//g'

or even:

sed 's/.._[0-9]\{1,\}=//g'



Cheers,
ND [smile]
 
OK, one another sed way:
Code:
sed 's![^ ]*=!!g' /path/to/input > outpout

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top