Sponsored Content
Top Forums Shell Programming and Scripting Search and retrieve the next Column. Post 302949048 by senhia83 on Monday 6th of July 2015 12:40:07 PM
Old 07-06-2015
another way

Code:
awk -F"FTOP," '/FTOP/{ split($2,a,"|"); print a[1]}' file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Retrieve line from a file based on a value in specific column

Hi, I have a file that has several values seperated by ":" 2006:John:Student:Football:Portugal:Cinema 2006:James:Engineer:Basket:Poland:Theatre 2007:Lucy:Diver:Gymnastic:England:Music 2007:Smith:Plumber:Basket:Spain:Poker I need make a filter based on the 5th field to find countries that... (1 Reply)
Discussion started by: efernandes
1 Replies

2. UNIX for Dummies Questions & Answers

(cont) Retrieve line from a file based on a value in specific column

HI, Your help was great: awk -F":" '$5 ~ /^P/{print }' file I would like to know what changes need to be done to this line code, so that I can put it in a shell script and call it as the example below. example: countries that start with chacater 'P' > country P Result: ... (0 Replies)
Discussion started by: efernandes
0 Replies

3. Shell Programming and Scripting

search and retrieve previous line in file

I've got a file with the following layout: #STMP FSgroup filename /filesysname1 filestatus 2 #STMP FSstatus filename /filesysname1 ratio 30 #STMP FSgroup filename ... (2 Replies)
Discussion started by: paulsew
2 Replies

4. Shell Programming and Scripting

Search on a particular column

Hi Guys, I like to search on a particular column for a string. This is my file 503018," 215/55HR18 BSW","Y"," ",20080204,20080204," ","T2456GH" 503019," 215/60HR17 BSW","Y"," ",20080204,20080204," ","T2456GH" 503020," 225/55R19 BSW","Y"," ",20080204,20080204," ","T2456GH" 505023,"... (1 Reply)
Discussion started by: mac4rfree
1 Replies

5. Shell Programming and Scripting

have to retrieve the distinct values (not duplicate) from 2nd column and display

I have a text file names test2 with 3 columns as below . We have to retrieve the distinct values (not duplicate) from 2nd column and display. I have used the below command but giving some error. NS3303 NS CRAFT LTD NS3303 NS CHIRON VACCINES LTD NS3303 NS ALLIED MEDICARE LTD NS3303 NS... (16 Replies)
Discussion started by: shirdi
16 Replies

6. Shell Programming and Scripting

sed/awk to retrieve max year in column

I am trying to retrieve that max 'year' in a text file that is delimited by tilde (~). It is the second column and the values may be in Char format (double quoted) and have duplicate values. Please help. (4 Replies)
Discussion started by: CKT_newbie88
4 Replies

7. Shell Programming and Scripting

search string in a file and retrieve 10 lines including string line

Hi Guys, I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same. can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies

8. Shell Programming and Scripting

Retrieve empty value in column

hi guys, how to retrieve "empty" value in column3 and column6 in the following text $ cat myfile.txt COL1 COL2 COL3 COL4 COL5 val1 long_value_name_that_takes_space value4 val5 COL6 COL7 ... (1 Reply)
Discussion started by: kholis
1 Replies

9. UNIX for Dummies Questions & Answers

Search word in 3rd column and move it to next column (4th)

Hi, I have a file with +/- 13000 lines and 4 column. I need to search the 3rd column for a word that begins with "SAP-" and move/skip it to the next column (4th). Because the 3rd column need to stay empty. Thanks in advance.:) 89653 36891 OTR-60 SAP-2 89653 36892 OTR-10 SAP-2... (2 Replies)
Discussion started by: AK47
2 Replies

10. UNIX for Beginners Questions & Answers

How to search a text in file and retrieve required lines following it with UNIX command?

I have requirement to search for a text in the file and retrieve required lines that is user defined with unix command. Eg: Find the text UNIX in the below file and need to return Test 8 & Test 9 Test 1 Test 2 Test 3 Test 4 UNIX Test 5 Test 6 Test 7 Test 8 Test 9 Result can... (8 Replies)
Discussion started by: Arunkumarsak4
8 Replies
HXCOUNT(1)							  HTML-XML-utils							HXCOUNT(1)

NAME
hxcount - count elements and attributes in HTML or XML files SYNOPSIS
hxcount [ file-or-URL ] DESCRIPTION
The hxcount command counts the number of elements and attributes of each type that appears in the input and prints a report on stdout. OPERANDS
The following operand is supported: file-or-URL The name or URL of an HTML or XML file. If absent, standard input is read instead. EXIT STATUS
The following exit values are returned: 0 Successful completion. > 0 An error occurred in the parsing of the HTML or XML file. hxcount will try to recover from the error and produce output anyway. ENVIRONMENT
To use a proxy to retrieve remote files, set the environment variables http_proxy and ftp_proxy. E.g., http_proxy="http://localhost:8080/" BUGS
Don't trust the output if there were errors in the input. Remote files (specified with a URL) are currently only supported for HTTP. Password-protected files or files that depend on HTTP "cookies" are not handled. (You can use tools such as curl(1) or wget(1) to retrieve such files.) SEE ALSO
asc2xml(1), hxprune(1), hxnormalize(1), hxnum(1), hxtoc(1), hxunent(1), xml2asc(1), UTF-8 (RFC 2279) 6.x 10 Jul 2011 HXCOUNT(1)
All times are GMT -4. The time now is 06:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy