01-29-2012
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
file_1.txt contains
aaa bbbb hhhh
vvvvv mmmmm iiiii
What i want is to search for the first coloumn of each line using awk.i.e as below:
awk '/aaa/ {printf(<>)}' file_1.txt
The print part (<>) should contain all the values(or coloumns ) in the particular line(here it... (8 Replies)
Discussion started by: jisha
8 Replies
2. Shell Programming and Scripting
Having arguments as follows
There are totally 210 error codes. I have already grep custom logs as follows
checkerr.sh
A awk '$1 == 0 || $1 ==1{print $0}' rep1.txt > success.log
B awk '$1 == 84 || $1 ==85 || $1==86 {print $0}' rep1.txt > MediaErr.log
i need all the other 205 error... (6 Replies)
Discussion started by: karthikn7974
6 Replies
3. Shell Programming and Scripting
How do we pass multiple arguments into awk :
name=john
age=12
now i have to pass both age and name into awk.. how to do it?
like : awk -v var=... (4 Replies)
Discussion started by: abhinav192
4 Replies
4. Shell Programming and Scripting
Hi
I have a file which looks like this:
$ cat my_file
f1acc: 1398
f1pdb: 495
f1trn: 1288
f1txn: 7326
t1trn: 8241
t1txn: 8292
p080$
I am trying to "egrep" a certain pattern from this file and put a value of a variable in front of each line, for example:
pnum=555
cat my_file |... (5 Replies)
Discussion started by: aoussenko
5 Replies
5. Shell Programming and Scripting
I am trying to pass max as a sommand line argument when I call awk.
Made the modification in the BEGIN but it is not working
I'm getting an error as below:
awk: txsrx.awk:82: (FILENAME=jcd.tx FNR=4161) fatal: cannot open file `40' for reading (No such file or directory)
Somehow it... (2 Replies)
Discussion started by: kristinu
2 Replies
6. Shell Programming and Scripting
I have an awk script below which I call using for example
awk -f ../../A-Scripts/select-model.awk iterations.txt 16x12 10
I want to be able to use it in a different way like this
awk -f ../../A-Scripts/select-model.awk iterations.txt nxz=16x12 iter=10
or
awk -f... (1 Reply)
Discussion started by: kristinu
1 Replies
7. Shell Programming and Scripting
I have an awk script where I pass some arguments
For example I will call awk in this fashion
awk -v anomaly=nAmon/pAnom -v aloc=zmin/ztran/zmax -v modeldepth=modeldepth
My problem is that I want to have the option to pass the variable anomaly in two ways.
Either using
-v... (10 Replies)
Discussion started by: kristinu
10 Replies
8. Shell Programming and Scripting
Hello all,
I would like to output a random number within a range for every line using awk and shuf. I think I'm almost there, but I don't know how to pass arguments to shuf within my awk script:
Input
1 12190 12227
1 12595 12721
1 13403 13639
1 14362 14829
1 14970 15038
awk:
awk '{... (2 Replies)
Discussion started by: DerSeb
2 Replies
9. Shell Programming and Scripting
Hi,
I am in critical need of help, Thanks a ton for your help.
I need to know how to pass the shell argument into nawk code in AIX. so that my file gets passed into that awk script and it can execute it part.
To be detail, i have more than 100 files and in those files a particular field... (6 Replies)
Discussion started by: Selva_2507
6 Replies
10. Shell Programming and Scripting
# more minusf.awk
#!/bin/awk -f
BEGIN {
FS=":";
}
{
if ( $2 == "" ) {
print $1 ": no password!";
}
}
# ./minusf.awk aa aa aa aa
awk: can't open aa (6 Replies)
Discussion started by: sri.phani
6 Replies
LEARN ABOUT PHP
pbmreduce
pbmreduce(1) General Commands Manual pbmreduce(1)
NAME
pbmreduce - read a portable bitmap and reduce it N times
SYNOPSIS
pbmreduce [-floyd|-fs|-threshold ] [-value val] N [pbmfile]
DESCRIPTION
Reads a portable bitmap as input. Reduces it by a factor of N, and produces a portable bitmap as output.
pbmreduce duplicates a lot of the functionality of pgmtopbm; you could do something like pnmscale | pgmtopbm, but pbmreduce is a lot
faster.
pbmreduce can be used to "re-halftone" an image. Let's say you have a scanner that only produces black&white, not grayscale, and it does a
terrible job of halftoning (most b&w scanners fit this description). One way to fix the halftoning is to scan at the highest possible res-
olution, say 300 dpi, and then reduce by a factor of three or so using pbmreduce. You can even correct the brightness of an image, by
using the -value flag.
OPTIONS
By default, the halftoning after the reduction is done via boustrophedonic Floyd-Steinberg error diffusion; however, the -threshold flag
can be used to specify simple thresholding. This gives better results when reducing line drawings.
The -value flag alters the thresholding value for all quantizations. It should be a real number between 0 and 1. Above 0.5 means darker
images; below 0.5 means lighter.
All flags can be abbreviated to their shortest unique prefix.
SEE ALSO
pnmenlarge(1), pnmscale(1), pgmtopbm(1), pbm(5)
AUTHOR
Copyright (C) 1988 by Jef Poskanzer.
02 August 1989 pbmreduce(1)