10-14-2008
Seconding freelong's request. Awk is heavily dependent on field separators, and so any analysis will require some knowledge of the structure of the input file. Can you post a few actual lines from it?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I have used SAR -b to get some Unix cache / buffer metrics and the results are confusing me a bit.
The pread/s & pwrit/s are showing 0. However the lread/s and lwrit/s are showing figures. I note also that the bread/s and bwrit/s are showing figures. I believe that pread/s and pwrit/s is not... (3 Replies)
Discussion started by: jimthompson
3 Replies
2. AIX
hello
with a sar i have this result:
System configuration: lcpu=48 ent=4.00
14:06:37 %usr %sys %wio %idle physc %entc
14:06:39 26 9 3 62 1.63 40.7
14:06:41 26 9 3 63 1.58 39.4
14:06:43 ... (0 Replies)
Discussion started by: pascalbout
0 Replies
3. UNIX for Advanced & Expert Users
Guys, this one is rather odd. I've got an array of numbers, and I'm trying to select only the records with the string "Random" in the 4th column. I'm using awk in this format:
awk '{ if (( $6 -eq Random )) print $0 }'
For some odd reason, this is simply giving me the list of all the entries... (4 Replies)
Discussion started by: Khoomfire
4 Replies
4. UNIX for Advanced & Expert Users
Hi All,
a bit of a weird one here. I'm trying to pass a variable into an awk command, and I keep getting an error.
I have the line
nawk -F"," -v red=$random_variable '{print $red}' $w_dir/$file_name > $w_dir/${column_name}
that keeps failing with the error
nawk: can't open file {print... (17 Replies)
Discussion started by: Khoomfire
17 Replies
5. Shell Programming and Scripting
my desired output is like this:
so the thing is, I only need to show every of this part out
but the frequency of that data is not fixed, so sometimes it may have 4 lines, or 6 lines or whatever in that file. However, the last line will always have empty space/line below it. (13 Replies)
Discussion started by: finalight
13 Replies
6. Shell Programming and Scripting
Hi Experts
I am facing a weird issue while using print statement in awk. I have a text file with 3 fields shown below:
# cat f1
234,abc,1000
235,efg,2000
236,jih,3000
#
When I print the third column alone, I dont face any issue as shown below:
# awk '{print $3 }' FS=, f1
1000
2000... (5 Replies)
Discussion started by: guruprasadpr
5 Replies
7. Shell Programming and Scripting
awk 'BEGIN{print 1.2.3.4}'
1.20.30.4
Can anyone explain why has extra "0" in the IP address? (3 Replies)
Discussion started by: newoz
3 Replies
8. Shell Programming and Scripting
HI
I have a following code:
CM_PROJHOME_DIR=`echo ${SCRNAME} | awk '{FS="/"; p=NF-5; for (i=1; i<= p ; i++) t=t$i"/"; print t}'`
where
SCRNAME=`whence $0 | sed -e 's/\.\///g'`
I need to modify the code to work in linux and also the interpretation like what is the code exactly doing.... (4 Replies)
Discussion started by: vee_789
4 Replies
9. Shell Programming and Scripting
Hi,
I have a simple awk script:
BEGIN{}
{
$a=$2-$1;
print $a
}
END{if(NR==0){
print "0"
}
}
to which I provide the following input
2.9 14
22.2 27 (4 Replies)
Discussion started by: jamie_123
4 Replies
10. Shell Programming and Scripting
Here is the awk code i wrote :
if ; then
gawk -v field_position="$field_position" -v field_length="$field_length" -v header="$header" -v trailer="$trailer" -v lr="$lr" '{
if(NR==1&&header=="1")
{
next
}
if(NR==lr&&trailer=="1")
{
next
}... (1 Reply)
Discussion started by: ysvsr1
1 Replies
LEARN ABOUT DEBIAN
malaga
MALAGA(1) Malaga quick reference MALAGA(1)
NAME
malaga - natural-language word and sentence analysis
SYNOPSIS
malaga [-morphology|-syntax] [-quoted] [-input input] project-file
DESCRIPTION
Malaga is a development environment for natural-language grammars based on the Left-Associative Grammar formalism. Malaga grammars can be
used for automatic morphological and/or syntactic analysis.
The program malaga is Malaga's user interface for analysing word forms and sentences, displaying the results and finding bugs in a grammar.
malaga requires the name of a language-dependent project-file as a command-line argument.
If no command line options are given, malaga starts in interactive mode, and you can enter commands. If you are not sure about the name of
a command, use the command help to get an overview of all malaga commands.
If you want to quit malaga, enter the command quit.
See info Malaga for details.
OPTIONS
-h[elp]
Print a help text about malaga's command line arguments and exit.
-i[nput] input
Analyse a single word or sentence given as command line argument (only valid in morphology or syntax mode).
-m[orphology]
Start malaga in morphology mode. In this mode word forms are read in from the standard input stream and analysed (one word form per
line). The analysis result are written to the standard output stream.
-q[uoted]
The input lines to be analysed are quoted (only valid in morphology or syntax mode).
-s[yntax]
Start malaga in syntax mode. In this mode sentences are read in from the standard input stream and analysed (one sentence per
line). The analysis result is written to the standard output stream.
-v[ersion]
Print malaga's version number and exit.
AUTHORS
Malaga was written by Bjoern Beutel. Numerous other people distributed to Malaga. This manpage was originally written for the Debian dis-
tribution by Antti-Juhani Kaijanaho.
SEE ALSO
mallex(1), malmake(1), malrul(1), malshow(1), malsym(1)
``Malaga 7, User's and Programmer's Manual''. Available in Debian systems via info Malaga, and, if the malaga-doc package is installed, in
various formats (DVI, Postscript, PDF, HTML) under /usr/share/doc/malaga-doc/.
Malaga 26 September 2006 MALAGA(1)