Re: Best sed syntax to extract numbers?



On 2008-12-01, Janis Papanagnou <janis_papanagnou@xxxxxxxxxxx> wrote:

If it's the last field you want to extract I'd prefer awk for its
simplicity...

$ echo 'Volume adjustment: 4.608' | awk '{print $NF}'
4.608

Thanks for that Janis, not only economical but simple enough for an awk
n00b to understand :-).

Andrew


--
echo 'hfrarg.naqerj@xxxxxxxxx' | \
tr 'A-M N-Z a-m n-z' 'N-Z A-M n-z a-m'
.



Relevant Pages

  • Re: ssh and chroot
    ... ++ echo /bin/mkdir ... ++ awk '' ... ++ grep '^/' ...
    (comp.security.ssh)
  • Re: sed question
    ... be printed twice. ... The only solution I've seen so far was from Janis in which went something like this: ... above) which looks like a bunch of cryptic characters and caveats to ... If had someone posted a few awk ...
    (comp.unix.shell)
  • Re: windows scripting with gawk
    ... gawk script but it is not effective ???? ... ENVIRONarray within awk. ... COPY of the environment variables names and associated values when awk ... echo %x% ...
    (comp.lang.awk)
  • Re: bash/awk communication over 2 fifos
    ... I tried to connect an awk job to a bash script using two fifos. ... echo "set one 111">in ... Awk exits when it gets EOF on its last input file and completes the END ...
    (comp.unix.shell)
  • Re: Variable substitution
    ... | awk ''` ... And why not just drop grep as well? ... Also the data we are missing is the exact format of the line in /tmp/ ...
    (comp.unix.shell)