Sponsored Content
Top Forums Shell Programming and Scripting replacing negative values in a column with zero Post 302667965 by ida1215 on Sunday 8th of July 2012 08:24:48 AM
Old 07-08-2012
thanks much for these one-liners,Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help in adding positive & negative values in a column

Hi Gurus, In my file I have an amount field from position 74 to 87, which contains values starting with '+' as well as '-'. I want to add all positive values in a varible called "CREDIT" and all negative values in a variable "DEBIT". I know, we can use grep to identify values with positive and... (4 Replies)
Discussion started by: berlin_germany
4 Replies

2. Shell Programming and Scripting

Sorting positive and negative values

Hello, I have a list like this : 1 2 -4 0 -3 -7 5 6 etc. Is there a way to remove all the positive values and print only the negative values, without using grep, sed or awk? Thanks, Prasanna (4 Replies)
Discussion started by: prasanna1157
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 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

5. UNIX for Dummies Questions & Answers

Replacing values in a column if they equal a certain value

Hi, I have a tab delimited text file where some lines have the string "NA" in the second column. For these lines, I want to replace NA with the value in the first column, the symbol underscore followed by the value in the fourth column. How do I go about doing that? Thanks! Input: 1 ... (3 Replies)
Discussion started by: evelibertine
3 Replies

6. Shell Programming and Scripting

Awk+colpos+negative if for 20 values

Hi All, i have 20 Obligors when ever i dont find all of them on particular row/line from each in put i need to print it in different file. using below command but it is not working please help at earliest. Steps: set -A FILENAME $( cat... (10 Replies)
Discussion started by: rajubollas
10 Replies

7. Shell Programming and Scripting

Conavert negative values to Zeros

Can anyone please assist me? Please find the attached input and output file for ur reference. a)Incase if i get negative value (ex:-000100) in the 11th column then i have to convert the value to 0000000(7 zeros-length is 7) and then print the entire record. b)Incase if there is no... (2 Replies)
Discussion started by: vinus
2 Replies

8. 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

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

How to sum the value with negative values?

Hi Gurus, I have requirement need to sum the value, the logic is if the value is negative then time -1, I tried below two ways. one is failed, another one doesn't work. awk -F"," '{if($8< 0 $8*-1 else $8) sum+=$8}{print sum, $8} END{printf("%.2f\n",sum)}' awk -F","... (4 Replies)
Discussion started by: ken6503
4 Replies
ExtUtils::Typemaps::Cmd(3pm)				 Perl Programmers Reference Guide			      ExtUtils::Typemaps::Cmd(3pm)

NAME
ExtUtils::Typemaps::Cmd - Quick commands for handling typemaps SYNOPSIS
From XS: INCLUDE_COMMAND: $^X -MExtUtils::Typemaps::Cmd -e "print embeddable_typemap(q{Excommunicated})" Loads "ExtUtils::Typemaps::Excommunicated", instantiates an object, and dumps it as an embeddable typemap for use directly in your XS file. DESCRIPTION
This is a helper module for ExtUtils::Typemaps for quick one-liners, specifically for inclusion of shared typemaps that live on CPAN into an XS file (see SYNOPSIS). For this reason, the following functions are exported by default: EXPORTED FUNCTIONS
embeddable_typemap Given a list of identifiers, "embeddable_typemap" tries to load typemaps from a file of the given name(s), or from a module that is an "ExtUtils::Typemaps" subclass. Returns a string representation of the merged typemaps that can be included verbatim into XS. Example: print embeddable_typemap( "Excommunicated", "ExtUtils::Typemaps::Basic", "./typemap" ); This will try to load a module "ExtUtils::Typemaps::Excommunicated" and use it as an "ExtUtils::Typemaps" subclass. If that fails, it'll try loading "Excommunicated" as a module, if that fails, it'll try to read a file called Excommunicated. It'll work similarly for the second argument, but the third will be loaded as a file first. After loading all typemap files or modules, it will merge them in the specified order and dump the result as an embeddable typemap. SEE ALSO
ExtUtils::Typemaps perlxs AUTHOR
Steffen Mueller "<smueller@cpan.org"> COPYRIGHT &; LICENSE Copyright 2012 Steffen Mueller This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-01-06 ExtUtils::Typemaps::Cmd(3pm)
All times are GMT -4. The time now is 08:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy