Sponsored Content
Full Discussion: Help on finding a number
Top Forums UNIX for Dummies Questions & Answers Help on finding a number Post 302692705 by sathyaonnuix on Tuesday 28th of August 2012 04:41:10 AM
Old 08-28-2012
Help on finding a number

Hello,

Here is my question. I have a file which contains the html values. I have to find the decimal number from it. It is tagged around >68.74<. Please help me on it..

Code:
alt=''  ><\/td>\n\t\t<td  align=\"right\" class='data_table_text data_table_conv_averages_text' \
style='padding-right: 2px;'>68.74<\/td>\n\t<\/tr>\n\t<tr>\n\t\t<td colspan='4'>\n\t\t\t<table cellspacing=0\
 cellpadding=0 border=0 width='100%'>\n\t\t\t\t<tr><td

I have tried
Code:
grep -o '[0-9][0-9]\.[0-9][0-9]' filename

it doesn't help with what i am looking for.. Since it brings all the values

In this case I am aware it is of [0-9][0-9].[0-9][0-9]..

How can i use my command so that it finds all the decimal numbers which are tagged around > < [no matter how many digits will be]

---------- Post updated at 03:41 AM ---------- Previous update was at 03:30 AM ----------

Ah i found out...

Code:
grep -o '>[0-9]*\.[0-9]*<'

Please correct me if this works..

Last edited by vbe; 08-28-2012 at 10:01 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

finding the number of open files

Hi!! Is there any way to find the number of open files at any time on the server?? I am on HP -UX-11 :confused: (1 Reply)
Discussion started by: jyotipg
1 Replies

2. Shell Programming and Scripting

finding biggest number

I think my script is working but i am trying to understand while I am tracing to see if it's realli working.. can somebody please comment.. also. is there different way to write this in shell? sh -x findbiggestnum 1 2 3 + big=0 + big=1 + big=2 + big=3 + echo 3 3 big=0 ... (3 Replies)
Discussion started by: hankooknara
3 Replies

3. Shell Programming and Scripting

Finding number ranges using grep

Is it possible for me to find numbers in a file by a range using grep? like cat data | cut -f1 | grep <info> Im trying to find information and extract every amount that is less than a number (ie less than 75 or whatever) Is this possible? (2 Replies)
Discussion started by: DKNUCKLES
2 Replies

4. Shell Programming and Scripting

Need help finding number of logins!

Let's say I am trying to find out how many times someone has logged into the machine. Use last to display all the different logins, several names pop up, some multiple times. All I have been able to figure out is the total number of logins, but I can't determine how to compare if $1(user name) is... (3 Replies)
Discussion started by: TiznaraN
3 Replies

5. Solaris

Finding port number !!

Hi all , I want know the port no on which a particular application is running. How to find that? Thanks in anticipation (11 Replies)
Discussion started by: kumarmani
11 Replies

6. Shell Programming and Scripting

Finding the nice(ni) number with PID?

Hi, is there a command that takes the PID of a process and that only diplays it's ni number? I`m pretty sure it would require pipes but I tried a few things that ended up miserably... Since the ps command doesn't show the ni unless I do ps -o ni but then I can't find a way to search the right... (2 Replies)
Discussion started by: Yakuzan
2 Replies

7. Shell Programming and Scripting

finding the number of dtsessions

I am trying to find out the number of dtsessions. using the command wc -l $FILE_NAME it works fine But when I try to assign this value to some variable using the command set NUM_DT_SESSION=$(wc -l $FILE_NAME) it shows error Variable syntax find below the complete command... (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies

8. Shell Programming and Scripting

Finding number of strings in List

I have a list of strings stored in $Lst Example set Lst = "John Fred Kate Paul" I want to return 4 in this case. (1 Reply)
Discussion started by: kristinu
1 Replies

9. Shell Programming and Scripting

finding number in exact column

Dear all, I want to find a number in exact column but I don't know how to do it. Here is the thing, data is shown below, and I want to find 416 in the first column and print it out, how should I deal with it? Thank you very much! ab33 50S01S 958 279.068999 67.251013 -150.172544 67.250000... (5 Replies)
Discussion started by: handsonzhao
5 Replies

10. Shell Programming and Scripting

Finding which is Running number

Hi All, I have a list of data in the listing file and I run row by row to process the record, but how to identify what is the current process line number ? Thanks. (2 Replies)
Discussion started by: ckwan
2 Replies
tag(3tcl)                                                                                                                                tag(3tcl)

NAME
tag - Manipulate tagged files SYNOPSIS
tag option ?arg arg ...? DESCRIPTION
The tag procedure provides a number of options for manipulating tagged files. COMMANDS
tag readfile filename Reads the file with the given filename and returns a list where each list element is a tag record, which is represented by a list of label-value pairs, or label-value-endlabel triples. The tag header is the first element returned. tag writefile filename list Takes a list in the format used internally in tcl programs for tagged data and writes it as a tagged file. tag extract list tests Takes a list in tagged format, and a list of conditions, and returns a new list in tagged format which contains those tag records which match the conditions. The tests is a list of test items, each of which is a list of the form { labelname condition matchvalue } The conditions are == String equals != String not equal <= Less than or equal -in Is the test value a member of the list given as the matchvalue -contains Does the match value contain the test value as a case insensitive substring. -earlier Date earlier -later Date later - dates are in ISO format (yyyy-mm-dd [hh:mm:ss]). -exists Does the label exist in this record. BUGS
tag readfile reads the whole file into memory before turning it into a list. Should be more memory efficient. The -earlier and -later comparisons require TCL8.3 AUTHOR
John Lines (john@paladin.demon.co.uk) July 3, 2000 tag(3tcl)
All times are GMT -4. The time now is 07:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy