Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Extract Numbers from a log file Post 302847201 by RudiC on Monday 26th of August 2013 12:28:16 PM
Old 08-26-2013
Which three-digit-number do you want, the first or the second?
Code:
sed -rn '/a href/ s/^[^"]*"([0-9]{3}).*$/\1/p' file
129
133
134
135
136

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extract only the "numbers" that are present in this file to a seperate file..

It may sounds too easy but appreciate any help on this.. i have a file with the below details: ****************************************** Please find the locked pernr details for the Time evaluation Personnel number could not be locked Person rejected: 04552737 Personnel number could not... (4 Replies)
Discussion started by: rohit.shetty84
4 Replies

2. Shell Programming and Scripting

Extract numbers below words with awk

Hi all, Please some help over here. I have a Sales.txt file containing info in blocks for every sold product in the pattern showed below (only for 2 products). NEW BLOCK SALE DATA PRODUCT SERIAL 79833269999 146701011945004 .Some other data .Some... (17 Replies)
Discussion started by: cgkmal
17 Replies

3. Shell Programming and Scripting

extract numbers from a word

Hi ppl, I am a bit lost on this...can some one assist. I know this can be down with awk or sed, but i cant get the exact syntax right. I need to only extract the numbers from a signle word ( eg abcd.123.xyz ) How can i extract 123 only ? Thanks (14 Replies)
Discussion started by: systemali
14 Replies

4. Shell Programming and Scripting

Extract numbers from text file work out average

Just wondering if someone could assist me with shell script I'm trying to write. I need to read the final column of a text file (shown below) and workout what the average number is. The text file will have a variable number of lines, I just want the script to pull out the values in the final field... (14 Replies)
Discussion started by: rich@ardz
14 Replies

5. UNIX for Dummies Questions & Answers

Extract numbers from .txt file

I need to extract all the p-value numbers and the rho numbers from a .txt file and write them as coma separated values in a new file. Ideally I would get two files in the end, one for p- values and one for rho. Any suggestions? I appreciate your help!!! The .txt file looks essentially like this... (5 Replies)
Discussion started by: eggali
5 Replies

6. Shell Programming and Scripting

Need help please with Grep/Sed command to extract text and numbers from a file

Hello All, I need to extract lines from a file that contains ALPHANUMERIC and the length of Alphanumeric is set to 16. I have pasted the sample of the lines from the text file that I have created. My problem is that sometimes 16 appears in other part of the line. I'm only interested to... (14 Replies)
Discussion started by: mnassiri
14 Replies

7. Shell Programming and Scripting

Extract rows from file based on row numbers stored in another file

Hi All, I have a file which is like this: rows.dat 1 2 3 4 5 6 3 4 5 6 7 8 7 8 9 0 4 3 2 3 4 5 6 7 1 2 3 4 5 6 I have another file with numbers like these (numbers.txt): 1 3 4 5 I want to read numbers.txt file line by line. The extract the row from rows.dat based on the... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

8. Shell Programming and Scripting

Extract numbers from file name-how to ?

Hello friends,I am new to Unix programming. how do I achieve the following in Unix shell script (I am running ksh on AIX) extract the number from name of file? My file format is like "LongFileName-1234.020614-221030.txt" now I want to extract value which is between (-) hyphen and (.) dot... (4 Replies)
Discussion started by: f150
4 Replies

9. Shell Programming and Scripting

Extract numbers from output file and compare to value

Hi, I developed a script which finally originates a similar output: net0:up,Tx=475198bps,Rx=31009bps net1:up,Tx=39596bps,Rx=35678bps Of course the figures change and also the amount of interfaces (ex: could be more then net0 and net1). This is done automatically. The next step i'm... (4 Replies)
Discussion started by: nms
4 Replies

10. UNIX for Beginners Questions & Answers

Substr with % - extract numbers only

# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.5 (Maipo) I have this script that will monitor filesystems and send me e-amil alerts. #! /bin/ksh DIST_LIST=monitor@...com WORKDIR=/home/monitor WARNLEVEL=90 MAIL_SUBJ="filesystems monitor on "$(hostname) ... (3 Replies)
Discussion started by: danielshell
3 Replies
iconv_646(5)                                            Standards, Environments, and Macros                                           iconv_646(5)

NAME
iconv_646 - code set conversion tables for ISO 646 DESCRIPTION
The following code set conversions are supported: +-----------------------------------------------------------------------+ | Code Set Conversions Supported | +----------+---------------+--------------+--------+--------------------+ | Code | Symbol |Target Code |Symbol | Target Output | +----------+---------------+--------------+--------+--------------------+ |ISO 646 | 646 |ISO 8859-1 |8859 |US ASCII | +----------+---------------+--------------+--------+--------------------+ |ISO 646de | 646de |ISO 8859-1 |8859 |German | +----------+---------------+--------------+--------+--------------------+ |ISO 646da | 646da |ISO 8859-1 |8859 |Danish | +----------+---------------+--------------+--------+--------------------+ |ISO 646en | 646en |ISO 8859-1 |8859 |English ASCII | +----------+---------------+--------------+--------+--------------------+ |ISO 646es | 646es |ISO 8859-1 |8859 |Spanish | +----------+---------------+--------------+--------+--------------------+ |ISO 646fr | 646fr |ISO 8859-1 |8859 |French | +----------+---------------+--------------+--------+--------------------+ |ISO 646it | 646it |ISO 8859-1 |8859 |Italian | +----------+---------------+--------------+--------+--------------------+ |ISO 646sv | 646sv |ISO 8859-1 |8859 |Swedish | +----------+---------------+--------------+--------+--------------------+ CONVERSIONS
The conversions are performed according to the following tables. All values in the tables are given in octal. ISO 646 (US ASCII) to ISO 8859-1 For the conversion of ISO 646 to ISO 8859-1, all characters in ISO 646 can be mapped unchanged to ISO 8859-1 ISO 646de (GERMAN) to ISO 8859-1 For the conversion of ISO 646de to ISO 8859-1, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 646de | ISO 8859-1 | ISO 646de | ISO 8859-1 | |100 | 247 |173 |344 | |133 | 304 |174 |366 | |134 | 326 |175 |374 | |135 | 334 |176 |337 | +---------------+----------------+----------------+---------------+ ISO 646da (DANISH) to ISO 8859-1 For the conversion of ISO 646da to ISO 8859-1, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 646da | ISO 8859-1 | ISO 646da | ISO 8859-1 | |133 | 306 |173 |346 | |134 | 330 |174 |370 | |135 | 305 |175 |345 | +---------------+----------------+----------------+---------------+ ISO 646en (ENGLISH ASCII) to ISO 8859-1 For the conversion of ISO 646en to ISO 8859-1, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------+ | Conversions|Performed | | ISO 646en | ISO 8859-1 | |043 |243 | +-----------------------------+-----------------------------+ ISO 646es (SPANISH) to ISO 8859-1 For the conversion of ISO 646es to ISO 8859-1, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 646es | ISO 8859-1 | ISO 646es | ISO 8859-1 | |100 | 247 |173 |260 | |133 | 241 |174 |361 | |134 | 321 |175 |347 | |135 | 277 | | | +---------------+----------------+----------------+---------------+ ISO 646fr (FRENCH) to ISO 8859-1 For the conversion of ISO 646fr to ISO 8859-1, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 646fr | ISO 8859-1 | ISO 646fr | ISO 8859-1 | |043 | 243 |173 |351 | |100 | 340 |174 |371 | |133 | 260 |175 |350 | |134 | 347 |176 |250 | |135 | 247 | | | +---------------+----------------+----------------+---------------+ ISO 646it (ITALIAN) to ISO 8859-1 For the conversion of ISO 646it to ISO 8859-1, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 646it | ISO 8859-1 | ISO 646it | ISO 8859-1 | |043 | 243 |140 |371 | |100 | 247 |173 |340 | |133 | 260 |174 |362 | |134 | 347 |175 |350 | |135 | 351 |176 |354 | +---------------+----------------+----------------+---------------+ ISO 646sv (SWEDISH) to ISO 8859-1 For the conversion of ISO 646sv to ISO 8859-1, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 646sv | ISO 8859-1 | ISO 646sv | ISO 8859-1 | |100 | 311 |140 |351 | |133 | 304 |173 |344 | |134 | 326 |174 |366 | |135 | 305 |175 |345 | |136 | 334 |176 |374 | +---------------+----------------+----------------+---------------+ FILES
/usr/lib/iconv/*.so conversion modules /usr/lib/iconv/*.t conversion tables /usr/lib/iconv/iconv_data list of conversions supported by conversion tables SEE ALSO
iconv(1), iconv(3C), iconv(5) SunOS 5.10 28 Apr 1997 iconv_646(5)
All times are GMT -4. The time now is 02:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy