Sponsored Content
Top Forums Shell Programming and Scripting sed to extract only floating point numbers from HTML Post 302351574 by pondlife on Wednesday 9th of September 2009 04:10:10 AM
Old 09-09-2009
Thanks Deepak! Works a treat Smilie

I've not used multi-line sed before so messed about a bit and got this to work:

Code:
sed -e 's/[^0-9. ]*//g' -e  's/ \+/ /g' test.html

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with floating point numbers in awk

hi all, i have the following problem using awk in a script i want to read the values from a column with real numbers and calculate the mean.the problem is that when i use a statement such as this num = $4 i cant find a way to convert the variable from string to floating point to perform... (7 Replies)
Discussion started by: kanagias
7 Replies

2. Shell Programming and Scripting

How to Compare Floating point / real numbers

Hai, Can you please guide me, to compare the floating point numbers. Eg. If then echo "value1 is grater " fi This code is not working properly when i excuted with floating values or real numbers (13 Replies)
Discussion started by: padarthy
13 Replies

3. Shell Programming and Scripting

floating point numbers in if

# if > then > echo "1" > else > echo "2" > fi -bash: How can i compare floating point numbers inside statement? (15 Replies)
Discussion started by: proactiveaditya
15 Replies

4. Shell Programming and Scripting

How to compare floating point numbers in shell script?

How can we compare 2 floating point numbers in SHELL script? (11 Replies)
Discussion started by: dearanik
11 Replies

5. Programming

Testing floating point numbers

Hi guys I have problem with my simple calculator, author of my book wrote One way I tried is to test if one the inpur number is grater than zero, and then substatct And my protptype function is #include <stdio.h> int main(void) { float a, b , result; ... (11 Replies)
Discussion started by: solaris_user
11 Replies

6. Programming

Floating Point

Anyone help me i cant found the error of floating point if needed, i added the code complete #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> typedef struct { int hh; int mm; int ss; char nom; int punt; }cancion; typedef struct... (9 Replies)
Discussion started by: Slasho
9 Replies

7. UNIX for Dummies Questions & Answers

Add floating point numbers from file

How do I use bash to add all the floating point numbers saved in a file like this? 490.47 244.61 263.07 131.59 246.81 115.20 (3 Replies)
Discussion started by: locoroco
3 Replies

8. Shell Programming and Scripting

Floating Point Numbers in c shell!

I have started using bash but this script which I am working on it, is in c chell. So here is my simple problem: set x = 0.4124\0.234 echo $x 0.4124.0.234 Same operation in Bash gives me correct result in my terminal. So there is something with my c shell that is causing this behaviour.... (8 Replies)
Discussion started by: dixits
8 Replies

9. Shell Programming and Scripting

Awk/sed HTML extract

I'm extracting text between table tags in HTML <th><a href="/wiki/Buick_LeSabre" title="Buick LeSabre">Buick LeSabre</a></th> using this: awk -F "</*th>" '/<\/*th>/ {print $2}' auto2 > auto3 then this (text between a href): sed -e 's/\(<*>\)//g' auto3 > auto4 How to shorten this into one... (8 Replies)
Discussion started by: p1ne
8 Replies

10. Shell Programming and Scripting

Comparison of floating point numbers in bash

I have the following code snippet in bash if ]; then minm=`echo "$diff" | bc` fi It works well for most of the cases. However lets say diff is -0.17 and minm is -0.0017. In such a case the comparison seems to fail. Is the correct way to compare a mixture of positive and... (12 Replies)
Discussion started by: ngabrani
12 Replies
HTML::FormatRTF(3)					User Contributed Perl Documentation					HTML::FormatRTF(3)

NAME
HTML::FormatRTF - Format HTML as RTF SYNOPSIS
use HTML::FormatRTF; my $out_file = "test.rtf"; open(RTF, ">$out_file") or die "Can't write-open $out_file: $! Aborting"; print RTF HTML::FormatRTF->format_file( 'test.html', 'fontname_headings' => "Verdana", ); close(RTF); DESCRIPTION
HTML::FormatRTF is a class for objects that you use to convert HTML to RTF. There is currently no proper support for tables or forms. This is a subclass of HTML::Formatter, whose documentation you should consult for more information on the new, format, format_file You can specify any of the following parameters in the call to "new", "format_file", or "format_string": lm Amount of extra indenting to apply to the left margin, in twips (twentieths of a point). Default is 0. So if you wanted the left margin to be an additional half inch larger, you'd set "lm => 720" (since there's 1440 twips in an inch). If you wanted it to be about 1.5cm larger, you'd set "lw => 850" (since there's about 567 twips in a centimeter). rm Amount of extra indenting to apply to the left margin, in twips (twentieths of a point). Default is 0. normal_halfpoint_size This is the size of normal text in the document, in half-points. The default value is 22, meaning that normal text is in 11 point. header_halfpoint_size This is the size of text used in the document's page-header, in half-points. The default value is 17, meaning that normal text is in 7.5 point. Currently, the header consists just of "p.pagenumber" in the upper-right-hand corner, and cannot be disabled. head1_halfpoint_size ... head6_halfpoint_size These control the font size of each heading level, in half-twips. For example, the default for head3_halfpoint_size is 25, meaning that HTML "<h3>...</h3>" text will be in 12.5 point text (in addition to being underlined and in the heading font). codeblock_halfpoint_size This controls the font size (in half-points) of the text used for "<pre>...</pre>" text. By default, it is 18, meaning 9 point. fontname_body This option controls what font is to be used for the body of the text -- that is, everything other than heading text and text in pre/code/tt elements. The default value is currently "Times". Other handy values I can suggest using are "Georgia" or "Bookman Old Style". fontname_code This option controls what font is to be used for text in pre/code/tt elements. The default value is currently "Courier New". fontname_headings This option controls what font name is to be used for headings. You can use the same font as fontname_body, but I prefer a sans-serif font, so the default value is currently "Arial". Also consider "Tahoma" and "Verdana". document_language This option controls what Microsoft language number will be specified as the language for this document. The current default value is 1033, for US English. Consult an RTF reference for other language numbers. hr_width This option controls how many underline characters will be used for rendering a "<hr>" tag. Its default value is currently 50. You can usually leave this alone, but under some circumstances you might want to use a smaller or larger number. no_prolog If this option is set to a true value, HTML::FormatRTF will make a point of not emitting the RTF prolog before the document. By default, this is off, meaning that HTML::FormatRTF will emit the prolog. This option is of interest only to advanced users. no_trailer If this option is set to a true value, HTML::FormatRTF will make a point of not emitting the RTF trailer at the end of the document. By default, this is off, meaning that HTML::FormatRTF will emit the bit of RTF that ends the document. This option is of interest only to advanced users. SEE ALSO
HTML::Formatter, RTF::Writer COPYRIGHT
Copyright (c) 2002 Sean M. Burke. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. AUTHOR
Sean M. Burke "<sburke@cpan.org>" perl v5.12.1 2004-06-02 HTML::FormatRTF(3)
All times are GMT -4. The time now is 10:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy