Help with finding a string and printing value in the next column


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with finding a string and printing value in the next column
# 8  
Old 12-14-2009
Quote:
Originally Posted by dennis.jacob
A shorter one.

Code:
 
awk '$2 ~ /janedoe/ { print $1" "$2" "$3 }'  file

Nope..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Printing most frequent string in column

I am trying to put together an script that will output the most frequent string in a column. This is what I have: awk '{count++} END {for ( i in count ) print i, count }' Of course, my script is outputting all different strings and counts. However, I just need the most frequent one (there... (7 Replies)
Discussion started by: Xterra
7 Replies

2. Shell Programming and Scripting

Inconsistent column printing

Hi, I have a file that has inconsistently numbered columns. Like row1 has 23 columns, and row 2 has 34 columns etc. I would like to re-order the first 8 columns as required and from the 9th column till the end, I would like to print it as it is. I tried to read the re-ordered 8 columns... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

3. UNIX for Dummies Questions & Answers

Printing out lines that have the same value in the first column but different value in the second

Hi, I have a text file that looks like the following: ILMN_1343291 6 74341083 74341772 ILMN_1343291 6 74341195 74341099 ILMN_1343295 12 6387581 6387650 ILMN_1651209 1 1657001 1657050 ILMN_1651209 5 83524260 83524309 I... (1 Reply)
Discussion started by: evelibertine
1 Replies

4. Shell Programming and Scripting

Printing second column of several files into one

HI All, I have exactly 100 text files with extension .txt. The files contain numbers like this: 1.txt 0.4599994 65914 0.40706193 190743 0.39977244 185019 0.39831382 74906 0.3915928 122428 0.38844505 39999 0.38820446 72691 0.38787442 176430 0.38670844 28791 0.38597047 91091... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

5. Shell Programming and Scripting

Reformatting single column text file starting new line when finding particular string

Hi, I have a single colum file and I need to reformat the file so that it creates a new line every time it come to an IP address and the following lines are corresponding rows until it comes to the next IP address. I want to turn this 172.xx.xx.xx gwpusprdrp02_pv seinwnprd03... (7 Replies)
Discussion started by: kieranfoley
7 Replies

6. UNIX for Dummies Questions & Answers

Printing a particular column using SED

Hi, i want to display only the particular column using SED command. For example, ps -ef|grep ash |sed -n '1p'|cut -d ' ' -f2   this gives 29067 ps -ef|grep ash |sed -n '1p'|awk '{print $2}'    this also gives the same  in the same way i need the solution using sed. Please... (4 Replies)
Discussion started by: pandeesh
4 Replies

7. Shell Programming and Scripting

grep on string and printing line after until another string has been found

Hello Everyone, I just started scripting this week. I have no background in programming or scripting. I'm working on a script to grep for a variable in a log file Heres what the log file looks like. The x's are all random clutter xxxxxxxxxxxxxxxxxxxxx START: xxxxxxxxxxxx... (7 Replies)
Discussion started by: rxc23816
7 Replies

8. Shell Programming and Scripting

Help finding a field value then printing line

Hello, I'm trying to only print out the file systems that are greater than 90% full. So far I've got: df -k >sawky8 cat sawky8 | grep -v Filesystem | sed "s/%//g;" >sawky9 cat sawky9 | awk '{print $4}' | read stot print $stot if ;then echo $LINE Problem is it stops after the first... (2 Replies)
Discussion started by: Grueben
2 Replies

9. UNIX for Dummies Questions & Answers

creating a file using the fist column and printing second column

Hello all. I have a problem that I need help solving. I would like to convert the following file: human pool1_12 10e-02 45 67 human pool1_1899 10e-01 45 29 human pool1_1829 10e-01 43 26 horse pool1_343 10e-20 65 191 horse pool1_454 10e-09 44 43... (5 Replies)
Discussion started by: viralnerd
5 Replies

10. UNIX for Dummies Questions & Answers

Printing highest value from one column

Hi, I have a file that looks like this: s6 98 s6 91 s6 56 s5 32 s5 10 s5 4 So what I want to do is print only the highest value for each value in the column: So the file will look like this: s6 98 s5 32 Thanks (4 Replies)
Discussion started by: phil_heath
4 Replies
Login or Register to Ask a Question
condor_stats(1) 					      General Commands Manual						   condor_stats(1)

Name
       condor_stats Display - historical information about the Condor pool

Synopsis
       condor_stats [-f filename] [-orgformat] [-pool centralmanagerhostname[:portnumber]] [time-range] query-type

Description
       condor_stats  displays  historic  information  about a Condor pool. Based on the type of information requested, a query is sent to the con-
       dor_collectordaemon, and the information received is displayed using the standard output. If the -foption is used, the information will	be
       written to a file instead of to standard output. The -pooloption can be used to get information from other pools, instead of from the local
       (default) pool. The condor_stats tool is used to query resource information (single or by platform), submitter and  user  information,  and
       checkpoint  server  information. If a time range is not specified, the default query provides information for the previous 24 hours. Other-
       wise, information can be retrieved for other time ranges such as the last specified number of hours, last week, last month, or a  specified
       date range.

       The information is displayed in columns separated by tabs. The first column always represents the time, as a percentage of the range of the
       query. Thus the first entry will have a value close to 0.0, while the last will be close to 100.0. If the  -orgformatoption  is	used,  the
       time is displayed as number of seconds since the Unix epoch. The information in the remainder of the columns depends on the query type.

       Note that logging of pool history must be enabled in the condor_collectordaemon, otherwise no information will be available.

       One query type is required. If multiple queries are specified, only the last one takes effect.

Time Range Options
       -lastday

	  Get information for the last day.

       -lastweek

	  Get information for the last week.

       -lastmonth

	  Get information for the last month.

       -lasthours n

	  Get information for the n last hours.

       -from m d y

	  Get  information  for  the  time  since the beginning of the specified date. A start date prior to the Unix epoch causes condor_stats to
	  print its usage information and quit.

       -to m d y

	  Get information for the time up to the beginning of the specified date, instead of up to now. A finish date in the  future  causes  con-
	  dor_stats to print its usage information and quit.

Query Type Arguments
       The query types that do not list all of a category require further specification as given by an argument.

       -resourcequery hostname

	  A  single resource query provides information about a single machine. The information also includes the keyboard idle time (in seconds),
	  the load average, and the machine state.

       -resourcelist

	  A query of a single list of resources to provide a list of all the machines for which the condor_collectordaemon has	historic  informa-
	  tion within the query's time range.

       -resgroupquery arch/opsys | ``Total''

	  A  query  of	a specified group to provide information about a group of machines based on their platform (operating system and architec-
	  ture). The architecture is defined by the machine ClassAd  Arch , and the operating system is defined by the machine	ClassAd   OpSys  .
	  The string ``Total'' ask for information about all platforms.

	  The  columns	displayed  are the number of machines that are unclaimed, matched, claimed, preempting, owner, shutdown, delete, backfill,
	  and drained state.

       -resgrouplist

	  Queries for a list of all the group names for which the condor_collectorhas historic information within the query's time range.

       -userquery email_address/submit_machine

	  Query for a specific submitter on a specific machine. The information displayed includes the number of running jobs and  the	number	of
	  idle jobs. An example argument appears as

	  -userquery jondoe@sample.com/onemachine.sample.com

       -userlist

	  Queries for the list of all submitters for which the condor_collectordaemon has historic information within the query's time range.

       -usergroupquery email_address | ``Total''

	  Query for all jobs submitted by the specific user, regardless of the machine they were submitted from, or all jobs. The information dis-
	  played includes the number of running jobs and the number of idle jobs.

       -usergrouplist

	  Queries for the list of all users for which the condor_collectorhas historic information within the query's time range.

       -ckptquery hostname

	  Query about a checkpoint server given its host name. The information displayed includes the number  of  Mbytes  received,  Mbytes  sent,
	  average receive bandwidth (in Kbytes/sec), and average send bandwidth (in Kbytes/sec).

       -ckptlist

	  Query for the entire list of checkpoint servers for which the condor_collectorhas historic information in the query's time range.

Options
       -f filename

	  Write the information to a file instead of the standard output.

       -pool centralmanagerhostname[:portnumber]

	  Contact the specified central manager instead of the local one.

       -orgformat

	  Display  the	information  in an alternate format for timing, which presents timestamps since the Unix epoch. This argument only affects
	  the display of resoursequery, resgroupquery, userquery, usergroupquery, and ckptquery.

Exit Status
       condor_statswill exit with a status value of 0 (zero) upon success, and it will exit with the value 1 (one) upon failure.

Author
       Condor Team, University of Wisconsin-Madison

Copyright
       Copyright (C) 1990-2012 Condor Team, Computer Sciences Department, University of  Wisconsin-Madison,  Madison,  WI.  All  Rights  Reserved.
       Licensed under the Apache License, Version 2.0.

       See the Condor Version 7.8.2 Manualor http://www.condorproject.org/licensefor additional notices. condor-admin@cs.wisc.edu

								  September 2012						   condor_stats(1)