Sponsored Content
Top Forums Shell Programming and Scripting to add special tag to a column based on column condition Post 302577413 by ahamed101 on Tuesday 29th of November 2011 04:04:18 AM
Old 11-29-2011
Try this...
Code:
awk '{match($0,"<TD>([0-9]*)</TD></TR>$",a);if(a[1]>50){gsub("<TR>","<TR style=something>")}}1' input_file

--ahamed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Filter the column and print the result based on condition

Hi all This is my output of the some SQL Query TABLESPACE_NAME FILE_NAME TOTALSPACE FREESPACE USEDSPACE Free ------------------------- ------------------------------------------------------- ---------- --------- ---------... (2 Replies)
Discussion started by: jhon
2 Replies

2. Shell Programming and Scripting

awk to select rows based on condition on column

I have got a file like this 003ABC00281020091005000100042.810001 ... (8 Replies)
Discussion started by: Maruti
8 Replies

3. Shell Programming and Scripting

need to remove duplicates based on key in first column and pattern in last column

Given a file such as this I need to remove the duplicates. 00060011 PAUL BOWSTEIN ad_waq3_921_20100826_010517.txt 00060011 PAUL BOWSTEIN ad_waq3_921_20100827_010528.txt 0624-01 RUT CORPORATION ad_sade3_10_20100827_010528.txt 0624-01 RUT CORPORATION ... (13 Replies)
Discussion started by: script_op2a
13 Replies

4. Shell Programming and Scripting

Filtering lines for column elements based on corresponding counts in another column

Hi, I have a file like this ACC 2 2 21 aaa AC 443 3 22 aaa GCT 76 1 33 xxx TCG 34 2 33 aaa ACGT 33 1 22 ggg TTC 99 3 44 wee CCA 33 2 33 ggg AAC 1 3 55 ddd TTG 10 1 22 ddd TTGC 98 3 22 ddd GCT 23 1 21 sds GTC 23 4 32 sds ACGT 32 2 33 vvv CGT 11 2 33 eee CCC 87 2 44... (1 Reply)
Discussion started by: polsum
1 Replies

5. Shell Programming and Scripting

Sum Of Column Based On Column Condition

I have a following inputfile MT,AP,CDM,TTML,MUM,GS,SUCC,3 MT,AP,CDM,TTSL,AP,GS,FAIL,9 MT,AP,CDM,RCom,MAH,GS,SUCC,3 MT,AP,CDM,RTL,HP,GS,SUCC,1 MT,AP,CDM,Uni,UPE,GS,SUCC,2 MT,AP,CDM,Uni,MUM,GS,SUCC,2 TTSL,AP,GS,MT,MAH,CDM,SUCC,20 TTML,AP,GS,MT,MAH,CDM,FAIL,10... (2 Replies)
Discussion started by: siramitsharma
2 Replies

6. Shell Programming and Scripting

awk to sum a column based on duplicate strings in another column and show split totals

Hi, I have a similar input format- A_1 2 B_0 4 A_1 1 B_2 5 A_4 1 and looking to print in this output format with headers. can you suggest in awk?awk because i am doing some pattern matching from parent file to print column 1 of my input using awk already.Thanks! letter number_of_letters... (5 Replies)
Discussion started by: prashob123
5 Replies

7. Shell Programming and Scripting

Check first column - average second column based on a condition

Hi, My input file Gene1 1 Gene1 2 Gene1 3 Gene1 0 Gene2 0 Gene2 0 Gene2 4 Gene2 8 Gene3 9 Gene3 9 Gene4 0 Condition: If the first column matches, then look in the second column. If there is a value of zero in the second column, then don't consider that record while averaging. ... (5 Replies)
Discussion started by: jacobs.smith
5 Replies

8. Shell Programming and Scripting

Sum column values based in common identifier in 1st column.

Hi, I have a table to be imported for R as matrix or data.frame but I first need to edit it because I've got several lines with the same identifier (1st column), so I want to sum the each column (2nd -nth) of each identifier (1st column) The input is for example, after sorted: K00001 1 1 4 3... (8 Replies)
Discussion started by: sargotrons
8 Replies

9. UNIX for Beginners Questions & Answers

Replacing tag based on condition

Hi All, I am having a file like below. The file will having information about the records.If you see the file the file is header and data. For example it have 1 men tag and the tag id will be come after headers. The change is I want to convert All pets tag from P to X. I did a sed like below... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

10. Shell Programming and Scripting

Add new column based in condition

At begining of column 2 the same block (2000) have 3 lines, in the next block (2336) it have 9 lines and for block (2524) 3 lines. ... (0 Replies)
Discussion started by: jiam912
0 Replies
LIPO(1) 						      General Commands Manual							   LIPO(1)

NAME
lipo - create or operate on fat files SYNOPSIS
lipo [-info] [-detailed_info] [-arch arch_type input_file] ... [ input_file] ... [-create] [-thin arch_type] [-replace arch_type file- name] ... [-remove arch_type] ... [-extract arch_type] ... [-extract_family arch_type] ... [-output output_file] [-segalign arch_type value] ... DESCRIPTION
The lipo command creates or operates on ``fat'' (multi-architecture) files. It only ever produces one output file, and never alters the input file. The operations that lipo performs are: listing the architecture types in a fat file; creating a single fat file from one or more input files; thinning out a single fat file to one specified architecture type; and extracting, replacing, and/or removing architec- tures types from the input file to create a single new fat output file. Only one option can be specified, with the exception of -arch, -output, and -segalign, which are used in combination with other options. The input_file argument is required, and only the -create option allows more than one input_file to be specified. The -output flag must be used, except with the -info and -detailed_info flags. The arch_type arguments may be any of the supported architecture names listed in the man page arch(3)exceptforVAXandMips. OPTIONS
-info Briefly list the architecture types in the input fat file (just the names of each architecture). -detailed_info Display a detailed list of the architecture types in the input fat file (all the the information in the fat header, for each archi- tecture in the file). -arch arch_type input_file Tells lipo that input_file contains the specified architecture type. The -arch arch_type specification is unnecessary if input_file is an object file, a fat file, or some other file whose architecture(s) lipo can figure out. -output output_file Specifies its argument to be the output file. -create Take the input files (or file) and create one fat output file from them. -thin arch_type Take one input file and create a thin output file with the specified arch_type. -replace arch_type file_name Take one fat input file; in the output file, replace the arch_type contents of the input file with the contents of the specified file_name. -remove arch_type Take one fat input file and remove the arch_type from that fat file, placing the result in the output file. -extract arch_type Take one fat input file and copy the arch_type from that fat file into a fat output file containing only that architecture. -extract_family arch_type Take one fat input file and copy all of the arch_types for the family that arch_type is in from that fat file into an output file containing only those architectures. The file will be thin if only one architecture is found or fat otherwise. -segalign arch_type value Set the segment alignment of the specified arch_type when creating a fat file containing that architecture. value is a hexadecimal number that must be an integral power of 2. This is only needed when lipo can't figure out the alignment of an input file (cur- rently not an object file), or when it guesses at the alignment too conservatively. The default for files unknown to lipo is 0 (2^0, or an alignment of one byte), and the default alignment for archives is 4 (2^2, or 4-byte alignment). SEE ALSO
arch(3) Apple Computer, Inc. October 23, 1997 LIPO(1)
All times are GMT -4. The time now is 10:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy