awk/nawk returning decimal values?


 
Thread Tools Search this Thread
Operating Systems Solaris awk/nawk returning decimal values?
# 1  
Old 03-25-2008
awk/nawk returning decimal values?

Hi

Running a specific nawk statement over a 17m lines files returns the following:

/bin/nawk: not enough args in .....
input record number 1,25955e+06, file test.1
source line number 1

I'd like to report the line number (in bold above) in decimal not floating so that i can spot it out.

I tried to pass the OTMF variable in the nawk statement to "%.8d" but nothing helped.

Any awk/nawk expert woudl be able to figure this out?

Thanks for your help guys
# 2  
Old 03-25-2008
Please don't post duplicate questions.

https://www.unix.com/shell-programmin...#post302178471
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Returning multiple values in Shell

Hi I have a code as the following #!/usr/bin/ksh set -x row() { a=$1 b=$2 c=$(($a + $b)) d=$(($a * $b)) echo $a $b } e=`row 2 3` set $e echo "The value of c is $c" echo "The value of d is $d" My requirement is I need to pass two arguments to a function and return two values... (5 Replies)
Discussion started by: Priya Amaresh
5 Replies

2. Shell Programming and Scripting

NAWK conversion of hexadecimal input to decimal output via printf, I am close I can feel it

I have searched and the answers I have found thus far have led me to this point, so I feel I am just about there. I am trying to convert a column of hexadecimal to decimal values so that I can filter out via grep just the data I want. I was able to pull my original 3 character hex value and... (10 Replies)
Discussion started by: PCGameGuy
10 Replies

3. UNIX for Dummies Questions & Answers

For loop returning more values

Hi All, Thanks all of you for the help you provide to me. Well, I have one more problem, where I am trying to pull file system information in the loop and display the filesystem percentege. I am using following code to achive this, nut it's giving the weired output. My file system is ... (1 Reply)
Discussion started by: alok.behria
1 Replies

4. Programming

returning multiple values from a function in C

hi how can I return multiple values from a C function. I tried the following: #include <stdio.h> void foo(int id, char *first_name, char *last_name) { /* this is just an example to illustrate my problem... real code makes use of the "id" parameter. */ first_name = (char... (8 Replies)
Discussion started by: Andrewkl
8 Replies

5. Shell Programming and Scripting

how to access values of awk/nawk variables outside the awk/nawk block?

i'm new to shell scripting and have a problem please help me in the script i have a nawk block which has a variable count nawk{ . . . count=count+1 print count } now i want to access the value of the count variable outside the awk block,like.. s=`expr count / m` (m is... (5 Replies)
Discussion started by: saniya
5 Replies

6. UNIX for Dummies Questions & Answers

AWK (NAWK) and filtering values

Hi , i try to filter input file : 17/04/2008 06:17:09 17/04/2008 00:00:02 keeping lines with hour > 06 as : 17/04/2008 06:17:09 i tried : CSL=06 nawk -v CSL="${CSL}" -F'' '/^\[/ { if ( $4 -gt $CSL) print $0 } ; /^\>/ { if ( $5 -gt $CSL) print $0 }' input_file.txt... (11 Replies)
Discussion started by: Nicol
11 Replies

7. UNIX for Advanced & Expert Users

Converting Binary decimal coded values to Ascii Values

Hi All, Is there any command which can convert binary decimal coded values to ascii values... i have bcd values like below оооооооооооо0о-- -v - Pls suggest a way to convert this. Thanks, Deepti.Gaur (3 Replies)
Discussion started by: gaur.deepti
3 Replies

8. Shell Programming and Scripting

awk/nawk returning decimal values?

Hi Running a specific nawk statement over a 17m lines files returns the following: /bin/nawk: not enough args in ..... input record number 1,25955e+06, file test.1 source line number 1 I'd like to report the line number (in bold above) in decimal not floating so that i can spot it out. ... (1 Reply)
Discussion started by: moutaye
1 Replies

9. Shell Programming and Scripting

Returning Values (shell Script)

I have an application on Informix 4GL, and I am invoking the shell script from the program, but I need to know if the shell script work fine or not, in order to continue the process. I know that we can use $? to get the final status but this is on unix command. How can I return a value from the... (3 Replies)
Discussion started by: jennifer01
3 Replies
Login or Register to Ask a Question