Sponsored Content
Top Forums Shell Programming and Scripting Add "1234" to specific field in second column Post 302750419 by elixir_sinari on Monday 31st of December 2012 10:37:12 PM
Old 12-31-2012
Quote:
Originally Posted by rangarasan
1 can be replaced by any positive integer.
1 may be replaced with any non-zero number, positive or negative.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to find all files containing "1234" in their inode number?

Hi, if there are 3 files with the following inode numbers: 012345 012346 012347 is there a way to find all those files containing "1234" as inode? i found out that i cant use any wildcards. or i just didnt put them in the right way. find . -inum ... ? thanks 4 help. devil (2 Replies)
Discussion started by: daredevil82m
2 Replies

2. UNIX for Dummies Questions & Answers

Explanation of "total" field in "ls -l" command output

When I do a listing in one particular directory (ls -al) I get: total 43456 drwxrwxrwx 2 root root 4096 drwxrwxrwx 3 root root 4096 -rwxrwxr-x 1 nobody nobody 3701594 -rwxrwxr-x 1 nobody nobody 3108510 -rwxrwxr-x 1 nobody nobody 3070580 -rwxrwxr-x 1 nobody nobody 3099733 -rwxrwxr-x 1... (1 Reply)
Discussion started by: proactiveaditya
1 Replies

3. Shell Programming and Scripting

"Join" or "Merge" more than 2 files into single output based on common key (column)

Hi All, I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations: 1. I am restrained to 2 input files only. 2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. UNIX for Dummies Questions & Answers

replace "," with "." only in specific columns of a file?

Hi all, I have this text file containing 9 columns separated by space. The 8th columns contains the numbers. C1 C2 C3 C4 C5 C6 C7 C8 C9 er rt yt gh iu nk il 0.07 xs yt lr ty bg iu zk nh 0,0005 lt ...etc. I want to replace the comma with full stop only in 8th coloumn. the output... (8 Replies)
Discussion started by: Unilearn
8 Replies

6. Shell Programming and Scripting

Substituting comma "," for dot "." in a specific column when comma"," is a delimiter

Hi, I'm dealing with an issue and losing a lot of hours figuring out how i would solve this. I have an input file which looks like this: ('BLABLA +200-GRS','Serviço ','TarifaçãoServiço','wap.bla.us.0000000121',2985,0,55,' de conversão em escada','Dia','Domingos') ('BLABLA +200-GRR','Serviço... (6 Replies)
Discussion started by: poliver
6 Replies

7. UNIX for Advanced & Expert Users

Should I say "field 8" or "column 8" in this case?

I saw some recent posts where I thought the terms "field" and "column" were being misused. I work with data a lot, and have my opinions. I'm wondering if those opinions are correct. ***** Rows seem clear - I don't think there is any controversy about what a row is, either for database or text... (10 Replies)
Discussion started by: hanson44
10 Replies

8. Shell Programming and Scripting

Awk,sed : change every 2nd field ":" to "|"

Hi Experts, I have a string with colon delimited, want 2nd colon to be changed to a pipe. data: 101:8:43:4:72:14:41:69:85:3:137:4:3:0:4:0:9:3:0:3:12:3: I am trying with sed, but can change only 1 occurance: echo "101:8:43:4:72:14:41:69:85:3:137:4:3:0:4:0:9:3:0:3:12:3:" | sed 's/:/|/2'... (5 Replies)
Discussion started by: rveri
5 Replies

9. Shell Programming and Scripting

Add " " to a field with awk

Hello, I would like to add " " in the last column of my file. For example, I have: "1";toto "2";tataI would like: "1";"toto" "2";"tata"I tried : awk 'BEGIN{FS=";"}$2="\""$2"\""' and the result was: "1";toto""If you have any ideas, I would appreciate your help, thanks you! Please use... (4 Replies)
Discussion started by: Nathalie10
4 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
POW(3)							     Linux Programmer's Manual							    POW(3)

NAME
pow, powf, powl - power functions SYNOPSIS
#include <math.h> double pow(double x, double y); float powf(float x, float y); long double powl(long double x, long double y); Link with -lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)): powf(), powl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99 DESCRIPTION
The pow() function returns the value of x raised to the power of y. RETURN VALUE
On success, these functions return the value of x to the power of y. If x is a finite value less than 0, and y is a finite noninteger, a domain error occurs, and a NaN is returned. If the result overflows, a range error occurs, and the functions return HUGE_VAL, HUGE_VALF, or HUGE_VALL, respectively, with the mathemat- ically correct sign. If result underflows, and is not representable, a range error occurs, and 0.0 is returned. Except as specified below, if x or y is a NaN, the result is a NaN. If x is +1, the result is 1.0 (even if y is a NaN). If y is 0, the result is 1.0 (even if x is a NaN). If x is +0 (-0), and y is an odd integer greater than 0, the result is +0 (-0). If x is 0, and y greater than 0 and not an odd integer, the result is +0. If x is -1, and y is positive infinity or negative infinity, the result is 1.0. If the absolute value of x is less than 1, and y is negative infinity, the result is positive infinity. If the absolute value of x is greater than 1, and y is negative infinity, the result is +0. If the absolute value of x is less than 1, and y is positive infinity, the result is +0. If the absolute value of x is greater than 1, and y is positive infinity, the result is positive infinity. If x is negative infinity, and y is an odd integer less than 0, the result is -0. If x is negative infinity, and y less than 0 and not an odd integer, the result is +0. If x is negative infinity, and y is an odd integer greater than 0, the result is negative infinity. If x is negative infinity, and y greater than 0 and not an odd integer, the result is positive infinity. If x is positive infinity, and y less than 0, the result is +0. If x is positive infinity, and y greater than 0, the result is positive infinity. If x is +0 or -0, and y is an odd integer less than 0, a pole error occurs and HUGE_VAL, HUGE_VALF, or HUGE_VALL, is returned, with the same sign as x. If x is +0 or -0, and y is less than 0 and not an odd integer, a pole error occurs and +HUGE_VAL, +HUGE_VALF, or +HUGE_VALL, is returned. ERRORS
See math_error(7) for information on how to determine whether an error has occurred when calling these functions. The following errors can occur: Domain error: x is negative, and y is a finite noninteger errno is set to EDOM. An invalid floating-point exception (FE_INVALID) is raised. Pole error: x is zero, and y is negative errno is set to ERANGE (but see BUGS). A divide-by-zero floating-point exception (FE_DIVBYZERO) is raised. Range error: the result overflows errno is set to ERANGE. An overflow floating-point exception (FE_OVERFLOW) is raised. Range error: the result underflows errno is set to ERANGE. An underflow floating-point exception (FE_UNDERFLOW) is raised. CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4, 4.3BSD, C89. BUGS
For a pole error, errno is set to EDOM; POSIX.1 says it should be set to ERANGE. If x is negative, then large negative or positive y values yield a NaN as the function result, with errno set to EDOM, and an invalid (FE_INVALID) floating-point exception. For example, with pow(), one sees this behavior when the absolute value of y is greater than about 9.223373e18. In version 2.3.2 and earlier, when an overflow or underflow error occurs, glibc's pow() generates a bogus invalid floating-point exception (FE_INVALID) in addition to the overflow or underflow exception. SEE ALSO
cbrt(3), cpow(3), sqrt(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-10 POW(3)
All times are GMT -4. The time now is 01:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy