Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to replace the field values, which are greater than the specified value with TRUE? Post 303034589 by RudiC on Tuesday 30th of April 2019 06:49:16 AM
Old 04-30-2019
Well, greater than (or equal) 100 means three digits and more, right? Try
Code:
sed -e 's/[0-9]\{3,\}/TRUE/g' file
    org1     org2     org3     org4     org5
gene1     TRUE     80     90     80     TRUE
gene2     30     70     50     50     TRUE
gene3     40     TRUE     60     40     TRUE
gene4     20     72     40     60     20


Last edited by RudiC; 04-30-2019 at 07:54 AM..
This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[awk]: Row begins by random number and field 10 is greater than 10.00%

Hello! I wish to extract the pid where CPU is above 10% last pid: 22621; load averages: 4.71, 5.04, 5.13 15:08:34 221 processes: 212 sleeping, 2 running, 1 stopped, 6 on cpu CPU states: %... (3 Replies)
Discussion started by: Lomic
3 Replies

2. Shell Programming and Scripting

Find top N values for field X based on field Y's value

I want to find the top N entries for a certain field based on the values of another field. For example if N=3, we want the 3 best values for each entry: Entry1 ||| 100 Entry1 ||| 95 Entry1 ||| 30 Entry1 ||| 80 Entry1 ||| 50 Entry2 ||| 40 Entry2 ||| 20 Entry2 ||| 10 Entry2 ||| 50... (1 Reply)
Discussion started by: FrancoisCN
1 Replies

3. Shell Programming and Scripting

Finding absolute values greater than a certain value

Hi I am posting here for the first time. I am trying to write a script that reads a data file and tries to determine if any absolute values that are above 0.5 I was thinking it ought to be possible to do this with awk somehow. Are there any suggestions before I start reinventing the wheel? ... (4 Replies)
Discussion started by: jackygrahamez
4 Replies

4. Shell Programming and Scripting

Replace a field where values are null in a file.

Hi, I've a pipe delimited file and wanted to replace the 3rd field to 099990 where the values are null. How can I achieve it using awk or sed. 20130516|00000061|02210|111554|03710|2|205069|SM APPL $80-100 RTL|S 20130516|00000061|02210|111554|03710|2|205069|SM APPL $80-100 RTL|S... (12 Replies)
Discussion started by: rudoraj
12 Replies

5. Shell Programming and Scripting

Find a blank field and replace values to NA

Hi All, i have a file like col1 col2 col3 13 24 NA 12 13 14 11 12 13 14 22 NA 18 26 NA in this file if i found "NA" other values in the line are also replace by NA Could you help me! (7 Replies)
Discussion started by: Shenbaga.d
7 Replies

6. Shell Programming and Scripting

awk to get values greater than

data.txt August 09 17:16 2013 August 09 17:17 2013 August 09 17:19 2013 August 09 17:20 2013 August 09 17:21 2013 August 09 17:22 2013 August 09 17:23 2013 August 09 17:24 2013 to print from a point in this file, to the end of the file, i type: awk '/August 09 17:22/,0' data.txt. ... (1 Reply)
Discussion started by: SkySmart
1 Replies

7. Shell Programming and Scripting

Help me to find a greater than or smaller than values

Hi, i need to find one of the value from my file is in between two numbers, that is the value is greater than 34 and smaller than 50, Ex: File.txt col1 col2 col3 col4 1 Name1 93 w 2 Name2 94 a 3 Name3 32 b 4 Name4 45 x 5 Name5 50 y 6 Name6 49 z here i need to find col3 values are... (7 Replies)
Discussion started by: Shenbaga.d
7 Replies

8. Shell Programming and Scripting

How to print values that are greater than 0.1 in at least 80% of the samples?

input sample1 sample2 sample3 sample4 sample5 sample6 sample7 sample8 sample9 sample10 v1 0.2 0.1 0.1 0 1 2 3 4 9 10 v2 0 0 0.01 0 0 0 0 0 0 0 v3 0 0 0 0 0 ... (35 Replies)
Discussion started by: quincyjones
35 Replies

9. UNIX for Advanced & Expert Users

Replace \n char true line Separator

Unix File is pipe delimited with 17 fields. We may get extra pipes in data also. We may get \n char (1 or more \n in one field or multi fileds) in data in any field. Need to replace \n true ( line separator) with 'space and bell char space' chars (' \a ') Not data \n. Input:... (1 Reply)
Discussion started by: rajeshkumare
1 Replies
XML::Smart::DTD(3pm)					User Contributed Perl Documentation				      XML::Smart::DTD(3pm)

NAME
XML::Smart::DTD - DTD parser for XML::Smart. DESCRIPTION
This will parse DTD and provides methods to access the information stored in the DTD. USAGE
use XML::Smart::DTD ; my $dtd = XML::Smart::DTD->new('some.dtd') ; if ( $dtd->child_exists('tag1','subtag1') ) { ... } use Data::Dumper ; print Dumper( $dtd->tree ) ; new METHODS
attr_exists ( TAG , ATTR ) Return TRUE if the attribute exists in the element TAG. child_exists ( TAG , CHILD ) Return TRUE if the child exists in the element TAG. elem_exists ( TAG ) Return TRUE if the element TAG exists. error Return the error list. get_attr_def ( TAG , ATTR ) Return the default value of an attribute get_attr_type ( TAG , ATTR ) Return the attribute type. get_attr_values ( TAG , ATTR ) Return the defined values of an attribute. get_attrs ( TAG ) Return the attribute list of a element. get_attrs_req ( TAG ) Return the required attribute list of a element. get_childs ( TAG ) Return the child list of an element. get_childs_req ( TAG ) Return the required child list of an element. get_elem_opt ( TAG ) Return the occurrence option of an element: ! REQUIRED AND ONLY ONE MATCH + 1 or more * 0 or more ? 0 or 1 get_elem_child_opt ( TAG , CHILD ) Same of get_elem_opt() but this element as a child of an element. is_attr_fix ( TAG , ATTR ) Return TRUE if an attribute is FIXED. is_attr_req ( TAG , ATTR ) Return TRUE if an attribute is REQUIRED. is_elem_any ( TAG ) Return TRUE if an element is ANY. is_elem_child_multi ( TAG , CHILD ) Return TRUE if an element can have multiple occurrences as a child of TAG. is_elem_child_opt ( TAG , CHILD ) Return TRUE if an element is optional as a child of TAG. is_elem_child_req ( TAG , CHILD ) Return TRUE if an element is optional as a child of TAG. is_elem_child_uniq ( TAG , CHILD ) Return TRUE if an element is required and unique as a child of TAG. is_elem_pcdata ( TAG ) Return TRUE if an element is PCDATA (have content). is_elem_empty ( TAG ) Return TRUE if an element is EMPTY (doesn't have attributes, content or children). is_elem_multi ( TAG ) Return TRUE if an element can have multiple occurrences globally. is_elem_opt ( TAG ) Return TRUE if an element is optional globally. is_elem_parent ( TAG , @PARENTS ) Return TRUE if the list of @PARENTS can be parent of element TAG. is_elem_req Return TRUE if an element is required globally. is_elem_uniq Return TRUE if an element is unique and required globally. root Return the root name of the DTD. tree Return the HASH tree of the DTD. SEE ALSO
XML::Smart, XML::DTDParser. AUTHOR
Graciliano M. P. <gm@virtuasites.com.br> I will appreciate any type of feedback (include your opinions and/or suggestions). ;-P THANKS
Thanks to Jenda@Krynicky.cz http://Jenda.Krynicky.cz that is the author of XML::DTDParser. COPYRIGHT
The DTD parser was based on XML-DTDParser-1.7 by Jenda@Krynicky.cz http://Jenda.Krynicky.cz This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2004-09-01 XML::Smart::DTD(3pm)
All times are GMT -4. The time now is 05:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy