N
N
NikitinRoman2015-12-29 16:00:22
linux
NikitinRoman, 2015-12-29 16:00:22

How to extract number using awk/sed from html file?

Good afternoon! There is an html file that contains the following line, you need to extract the amount from the file, in our case 11 111, and output it as 11111.

<dl><dt>Текущий баланс</dt><dd><div class="span28"><span class="money bold">11 111<sup class="hide-text">.</sup><sup>32</sup>

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Spetros, 2015-12-29
@Spetros

For html it is customary to use parsers.

S
Sergey Petrikov, 2015-12-29
@RicoX

If long and do not think:

grep "Текущий баланс" | sed -e 's/^.*money bold>//g' -e 's/<sup class=hide-text>.*$//g' -e 's/\ //g'

N
NikitinRoman, 2015-12-29
@NikitinRoman

Can you show a working example?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question