Sponsored Content
Full Discussion: Nawk special numbers
Top Forums Shell Programming and Scripting Nawk special numbers Post 302943306 by MadeInGermany on Thursday 7th of May 2015 06:48:12 AM
Old 05-07-2015
Well, this feature might be fine for freaks, but I call it counterproductive in practice.
It hit me when I was summing up numeric columns in a command output.
Usually, commands like ps or df have a title line with words that (n)awk casts to 0; so I did not exclude it.
Until it happened that a title line had the word INFOSmilie
 

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

NAWK - seach pattern for special characters - } dbl qt - sng qt

i'm puzzled.... trying to look for the pattern }"'. but the below code returns to me the message below (pattern is curley queue + dbl qt + sng qt + period) nawk -v pat="\}\"\'\."' { if (match($0, pat)) { before = substr($0,1,RSTART-1); ... (11 Replies)
Discussion started by: danmauer
11 Replies

3. Shell Programming and Scripting

read numbers from file and output which numbers belongs to which range

Howdy experts, We have some ranges of number which belongs to particual group as below. GroupNo StartRange EndRange Group0125 935300 935399 Group2006 935400 935476 937430 937459 Group0324 935477 935549 ... (6 Replies)
Discussion started by: thepurple
6 Replies

4. Shell Programming and Scripting

Nesting - two nawk into one nawk

hi people; this is my two awk code: nawk '/cell+-/{r=(NF==8) ? $4FS$5FS$6 : NF==7 ? $4FS$5 : $4 ;c=split(r,rr);for (i=1;i<=c;i++){if(rr != "111111"){printf($3" %d ""\n",(i+3))}}printf("")}' /home/gc_sw/str.txt > /home/gc_sw/predwn.txt nawk -F'*' '{gsub(/ *$/,"")}$0=$1$($NF-2)'... (2 Replies)
Discussion started by: gc_sw
2 Replies

5. Shell Programming and Scripting

the smallest number from 90% of highest numbers from all numbers in file

Hello All, I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns. I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions. If I... (11 Replies)
Discussion started by: Apfik
11 Replies

6. Programming

generating pair of numbers in special order

I need some help in generating pair of numbers in orders using FORTRAN code. The order is like following. loop_1: 1,2 2,3 3,4 4,5 5,6 6,7 7,8 ..... until <= 2000 loop_2: 1,3 3,5, 5,7 7,9 9,11 11,13 ........until <= 2000 loop_3: 1,4, 4,7 7,10 10,13 13,17 ..... until... (3 Replies)
Discussion started by: vjramana
3 Replies

7. Shell Programming and Scripting

Find Special/Null/Control Chars and Print Line Numbers

Hi All, This might be a basic question... I need to write a script to find all/any Speacial/Null/Control Chars and Print Line Numbers from an input file. Output something like Null Characters in File Name at : Line Numbers Line = Print the line Control Characters in File Name at : Line... (2 Replies)
Discussion started by: Kevin Tivoli
2 Replies

8. Shell Programming and Scripting

Nawk Problem - nawk out of space in tostring on

Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Discussion started by: Abhiraj Singh
12 Replies

9. Shell Programming and Scripting

Delete Numbers, Spaces, Special Character from the begining of the line of a file

Hi All, I want to keep the name of the songs with their respective extensions only. Sample Code ======== 03 Choti choti gaiya choti choti gaval.mp3 03---Brazil Dhol.mp3 03 PAYALIYA .mp3 04 - Isq Risk .mp3 04%20-%20Oh%20My%20Love(wapking.in).mp3 08 - A2 - Aasan Nahin Yahan .mp3 AE... (3 Replies)
Discussion started by: Pramod_009
3 Replies

10. UNIX for Beginners Questions & Answers

Remove Special Characters and Numbers From a Wordlist

I sux at this type of stuff. I have a huge wordlist. I want to get rid of everything in each word except the letters. I want to remove numbers and all special characters. And since this list was created using cewl I some how picked up something like so Latin characters and would like to remove them... (6 Replies)
Discussion started by: sub terra
6 Replies
MAN(1)							      General Commands Manual							    MAN(1)

NAME
man - print sections of this manual SYNOPSIS
man [ option ... ] [ chapter ] title ... DESCRIPTION
Man locates and prints the section of this manual named title in the specified chapter. (In this context, the word `page' is often used as a synonym for `section'.) The title is entered in lower case. The chapter number does not need a letter suffix. If no chapter is speci- fied, the whole manual is searched for title and all occurrences of it are printed. Options and their meanings are: -t Phototypeset the section using troff(1). -n Print the section on the standard output using nroff(1). -k Display the output on a Tektronix 4014 terminal using troff(1) and tc(1). -e Appended or prefixed to any of the above causes the manual section to be preprocessed by neqn or eqn(1); -e alone means -te. -w Print the path names of the manual sections, but do not print the sections themselves. (default) Copy an already formatted manual section to the terminal, or, if none is available, act as -n. It may be necessary to use a filter to adapt the output to the particular terminal's characteristics. Further options, e.g. to specify the kind of terminal you have, are passed on to troff(1) or nroff. Options and chapter may be changed before each title. For example: man man would reproduce this section, as well as any other sections named man that may exist in other chapters of the manual, e.g. man(7). FILES
/usr/man/man?/* /usr/man/cat?/* SEE ALSO
nroff(1), eqn(1), tc(1), man(7) BUGS
The manual is supposed to be reproducible either on a phototypesetter or on a terminal. However, on a terminal some information is neces- sarily lost. MAN(1)
All times are GMT -4. The time now is 11:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy