Sponsored Content
Top Forums Shell Programming and Scripting awk find which column contains string Post 302980918 by RudiC on Monday 5th of September 2016 04:15:26 AM
Old 09-05-2016
With a recent shell:
Code:
TMP=${USEDMEMORY#*memAvailReal=}
echo ${TMP%% *}
1109812

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

find the string in the 55th column [awk]

hi people, i need a help!!!! i'm trying use a awk command, but i dont have success!.. i need find the string 'FL' in 55th column in a length file of 2.4Gb!!! Attempts: awk -F"\t" ' { if ($55 ~ /^F/) print $0} ' FILE awk -F"\t" ' { if ($55 ~ /FL/) print $0} ' FILE awk -F"\t" ' { if... (5 Replies)
Discussion started by: gandarez
5 Replies

2. UNIX for Dummies Questions & Answers

find the string in the 55th column [awk]

hi people, i need a help!!!! i'm trying use a awk command, but i dont have success!.. i need find the string 'FL' in 55th column in a length file of 2.4Gb!!! Attempts: awk -F"\t" ' { if ($55 ~ /^F/) print $0} ' FILE awk -F"\t" ' { if ($55 ~ /FL/) print $0} ' FILE awk -F"\t" ' { if... (7 Replies)
Discussion started by: gandarez
7 Replies

3. Shell Programming and Scripting

find expression with awk in only one column, and if it fits, print whole column

Hi. How do I find an expression with awk in only one column, and if it fits, then print that whole column. 1 apple oranges 2 bannanas pears 3 cats dogs 4 hesaid shesaid echo "which number:" read NUMBER (user inputs number 2 for this example) awk " /$NUMBER/ {field to search is field... (2 Replies)
Discussion started by: glev2005
2 Replies

4. Shell Programming and Scripting

Awk - find string, search lines below string for other strings

What's the easiest way to search a file for a specific string and then look for other instances after that? I want to search for all Virtual Hosts and print out the Server Name and Document Root (if it has that info), while discarding the rest of the info. Basically my file looks like this: ...... (6 Replies)
Discussion started by: Mbohmer
6 Replies

5. Emergency UNIX and Linux Support

awk cut column based on string

Using awk I required to cut out column contain word "-Tag" regardles of any order of contents and case INsensitive -Tag:messages -P:/var/log/messages -P:/var/log/maillog -K:Error -K:Warning -K:critical Please Guide ...... --Shirish Shukla ---------- Post updated at 05:58 AM... (15 Replies)
Discussion started by: Shirishlnx
15 Replies

6. Shell Programming and Scripting

Find String and add to next column

Dear All, I have file input input01.txt 14193 40 153 14208 40 168 14283 45 243 14298 40 258 14313 41 273 14328 44 288 ... ...input02.txt 499815.5 9886300.0 14208 94.2 1957.1 499815.5 9886300.0 14208 314.2 2101.0 ... (2 Replies)
Discussion started by: attila
2 Replies

7. Shell Programming and Scripting

Column string matching in awk

Hello, I want pick up rows from input with conditions: 1) col2 is 2 replicate of col1 joint with "/" 2) col3 is a joint string as replicate of each side of the "/" symbol 3) col2 not equal to col3 input: TG TG/TG TG/TGG C C/C C/CG C C/G CA/CA C C/C CA/CA AG AG/AG... (3 Replies)
Discussion started by: yifangt
3 Replies

8. Shell Programming and Scripting

Count occurrence of string in a column using awk

Hi, I want to count the occurrences of strings in a column and display as in example below: Input: get1 345 789 098 get2 567 982 090 fet4 777 610 632 get1 800 544 230 get1 600 788 451 get2 892 321 243 get1 673 111 235 fet3 789 220 278 fet4 768 222 341 output: 4 get1 345 789... (7 Replies)
Discussion started by: aydj
7 Replies

9. Shell Programming and Scripting

awk to find maximum and minimum from column and store in other column

Need your support for below. Please help to get required output If column 5 is INV then only consider column1 and take out duplicates/identical rows/values from column1 and then put minimum value of column6 in column7 and put maximum value in column 8 and then need to do subtract values of... (7 Replies)
Discussion started by: as7951
7 Replies

10. Shell Programming and Scripting

Script to find string based on pattern and search for its corresponding rows in column

Experts, Need your support for this awk script. we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file Need to grep row whose string contains 9K from column 1. When found... (6 Replies)
Discussion started by: as7951
6 Replies
SHTOOL-ARX.TMP(1)					      GNU Portable Shell Tool						 SHTOOL-ARX.TMP(1)

NAME
shtool-arx - GNU shtool ar(1) extensional command SYNOPSIS
shtool arx [-t|--trace] [-C|--command cmd] op archive file [file ...] DESCRIPTION
shtool arx is a wrapper around the archiving tool ar(1). It provides the ability to create archives out of existing archives, i.e., if one of file matches ""*.a"", the archive member files of file are used instead of file itself. The trick of this command is the automatic handling of archive members which is especially interesting if one wants to construct a (usually top-level) library archive out of pre-built sub-library archives (usually staying inside subdirs) in a large source tree. For GNU libtool based projects, a similar functionality is provided by GNU libtool internally, too. OPTIONS
The following command line options are available. -t, --trace Shows the actually involved shell commands. -C, --command cmd Set the used ar(1) command to cmd instead of just "ar" (searched in $PATH). EXAMPLE
# Makefile AR=ar RANLIB=ranlib : OBJS=foo.o bar.o LIBS=baz/libbaz.a quux/libquux.a : libfoo.a: $(OBJS) $(LIBS) shtool arx -C $(AR) rc libfoo.a $(OBJS) $(LIBS) $(RANLIB) libfoo.a HISTORY
The GNU shtool arx command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1999 for GNU shtool. It was prompted by need to build libraries out of sub-libraries inside the OSSP project. SEE ALSO
shtool(1), ar(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-ARX.TMP(1)
All times are GMT -4. The time now is 02:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy