extract particular string 
Author Message
 extract particular string

Hi,
Excuse me if the question seems to be evident ?

I have a line like that :          1:213123313231321321
                                 or      10:2145232144523

with the same command I want to extract the number ahead the :  .(in
this case 1 or 10 )

Thank you ...

bye



Sat, 13 Jul 2002 03:00:00 GMT  
 extract particular string

Quote:

> Hi,
> Excuse me if the question seems to be evident ?

> I have a line like that :          1:213123313231321321
>                                  or      10:2145232144523

> with the same command I want to extract the number ahead the :  .(in
> this case 1 or 10 )

> Thank you ...

> bye

use

cut -f1 -d: filename
or echo $STRINGNAME | cut -f1 -d:

or

awk -F: {'print $1}' filename

etc

--
Kevin Miles



Sat, 13 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. To extract a particular line from a file.

2. How to extract all files/dirs created in a particular date

3. How to insert a string in a file at a particular position

4. Finding a particular string

5. extracting part of a string

6. extracting a string from a line

7. range pattern / extract string from input buffer

8. Extracting string-parts into records ?

9. Extract string

10. Extract string defined by RE - Reinsert new location

11. Extracting function-names from input strings (especially in Windows Programming)

12. Extracting Resource String from Resource Table

 

 
Powered by phpBB® Forum Software