Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Replacing values in a column if they equal a certain value Post 302834343 by rdrtx1 on Thursday 18th of July 2013 05:59:44 PM
Old 07-18-2013
try:
Code:
awk '$2 == "NA" {$2=$1":"$4} 1' OFS="\t" infile

This User Gave Thanks to rdrtx1 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

My Values are Equal but They are Not

Does anybody understand why this is not being interpreted as true. Script: #!/bin/bash errored=`grep "errored" new_update_scripts.txt` echo $errored = "errored" if ; then echo true else echo false fi Output: $ UpdateScripts errored = errored false (7 Replies)
Discussion started by: scottwmackey
7 Replies

2. Shell Programming and Scripting

compare columns for equal values and output a summary

Hi all I am trying to scan a file that has 3 columns: red blue 123351 red blue 848655 red blue 126354 red blue 023158 black white 654896 red blue 650884 I want an output that sums the rows that have matching columns 1 and 2 :wall: red blue has 5 entries black white has 1 entry ... (4 Replies)
Discussion started by: reno
4 Replies

3. Shell Programming and Scripting

Replacing column 1 in one file with values in other file

Please help me with an shell / awk script to achieve following; File-1: ABCDW01 12322 23322 BDADW01 22232 24453 EDFAW00 32232 23422 and so on, notice that the first coloumn is a code and the another file contains the real value of each entry in the first colum above but not in a... (4 Replies)
Discussion started by: digipak
4 Replies

4. Shell Programming and Scripting

replacing negative values in a column with zero

Hi, i need help on replacing negative values in a column with 0. any quick fix on this? thanks much. for instance, input: 1 2.3 -0.4 -25 12 13 45 -12 desired output 1 2.3 0 0 12 13 45 (4 Replies)
Discussion started by: ida1215
4 Replies

5. Shell Programming and Scripting

Replacing column values

hi all , ( perl) i am trying to replace jst one column in a file for eg month dayofweek dealar car-name jan thurs mercedes c300 feb wed lexus is300 all this data is in a master file and i want to replace jan with 1 feb... (5 Replies)
Discussion started by: technoman
5 Replies

6. Shell Programming and Scripting

awk file to read values from Db2 table replacing hard coded values

Hi, I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below... if (start_new_rec=="true"){ exclude_user="false"; user=toupper($6); match(user, "XXXXX."); if (RSTART ==2 ) { ... (9 Replies)
Discussion started by: asandy1234
9 Replies

7. Shell Programming and Scripting

Replacing values into a single column. sed/PERL

Hello everyone, i need to replace in the second column of my csv file, points by nothing and dash by comma like this: Input: 1 2 1;12.111.312-2;1.2;2;1-3 2 1 1;11.212.331-1;3.3;1;2-2 Output: 1 2 1;12111312;2;1.2;2;1-3 2 1 1;11212331;1;3.3;1;2-2 SED or PERL commands preferably. ... (7 Replies)
Discussion started by: satir
7 Replies

8. Shell Programming and Scripting

Deleting consecutive equal values in a file

Hello everyone, I have a requirement as shown below. I need to delete consecutive same values from the source file and give it as output file. Source: a,b,c,d,e,e,f,g Target: a,b,c,d,f,g The repeating value "e" should be deleted from the file completely. How can I achieve this... (14 Replies)
Discussion started by: vamsikrishna928
14 Replies

9. UNIX for Dummies Questions & Answers

Help in replacing column values

Hello All, I am having the file as below .I need to replace column 9-12 with some other values. In the below file I need to replace 1509 to 1508 and 1508 to 1507 .Can you please help me in how to do that Thanks, Arun ... (10 Replies)
Discussion started by: arunkumar_mca
10 Replies

10. Shell Programming and Scripting

Delete row if both percentage values are equal to zero

Hello, I have compiled a script but I have stucked at one point. Each line contains two pcs of % value and what I want to do is to delete any line if both % values are zero. data: expected output: ow3 should be deleted as both percentage value in related line are equal to zero. ... (2 Replies)
Discussion started by: baris35
2 Replies
Locale::Codes::LangFam(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangFam(3pm)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-11-04 Locale::Codes::LangFam(3pm)
All times are GMT -4. The time now is 07:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy