04-12-2005
ohh i think it must be a problem with the file im trying to read,
i just tried
/home/test >echo "gives Me Output Like This" | awk '{print $1 " " $2 " " $3}'
and it works fine. thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
If in my search string with awk, if I have spaces, I am getting an awk error.
e.g. awk /A B/ filename
How can I search the pattern which has space within? (1 Reply)
Discussion started by: videsh77
1 Replies
2. Shell Programming and Scripting
I have a string and want to replace the / with a space.
For example having "SP/FS/RP" I want to get "SP FS RP"
However I am having problems using gsub
set phases = `echo $Aphases | awk '{gsub(///," ")}; {print}'` (5 Replies)
Discussion started by: kristinu
5 Replies
3. UNIX for Dummies Questions & Answers
Hi experts,
why does
$ echo "one two three" | awk '{$3="my tree"; print $0}'
one two my tree
work,
but
$ var="my tree"
$ echo "one two three" | awk '{$3="'$var'"; print $0}'
awk: {$3="my
awk: ^ unterminated string
does not work?
How can the variable tha contains a space be... (2 Replies)
Discussion started by: GermanicGalore
2 Replies
4. Shell Programming and Scripting
Hi,
Need some help with awk and blank fieds..
# last -n 2
gml4410 pts/0 host3 Fri Nov 18 07:46 - 07:53 (00:06)
nmc5060 host2 Thu Nov 17 15:29 - 15:30 (00:00)
I need to extract field1(userid) , field5(month) and field 6(day).
Notice the second line has blank space... (2 Replies)
Discussion started by: vignes10
2 Replies
5. Shell Programming and Scripting
I have an AWK script that uses multiple delimiters in the FS variable.
FS="+"
My awk script takes a file name such as this:
12345_smith_bubba_12345_20120215_4_0.pdf and parses it out based on the under score. Each parsed field then has some code for data validation etc.
This script has... (12 Replies)
Discussion started by: reno4me
12 Replies
6. Shell Programming and Scripting
Hi Team,
Can you please tell me how to get a used space in KB LINUX and free space in KB separate commands.
For example:
$df -k
/rer (apdfp01.xxx.com:/var/adm/rash/MT) : 2066900 total allocated Kb
4579 free allocated Kb
16121 used allocated Kb
89 % allocation used
/dev/deviceFS1... (5 Replies)
Discussion started by: indira_s
5 Replies
7. UNIX for Advanced & Expert Users
I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation?
Here is my query:
cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}'
02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies
8. Shell Programming and Scripting
Hi ,
Please suggest me how do I use : (colon and one space) as a delimiter in awk
Best regards,
Vishal (2 Replies)
Discussion started by: Vishal_dba
2 Replies
9. Shell Programming and Scripting
I am searching a file and not able to escape a space if $i has a space in the name. I tried escaping it with a \ and also trying to add it to allow for spaces in the search. Neither are correct as the first awk only outputs path and the second awk doesn't run. Thank you :).
first awk
awk... (3 Replies)
Discussion started by: cmccabe
3 Replies
10. UNIX for Beginners Questions & Answers
Hi All ,
I am having an input file like this
Input file
r s
e y
Pin Numbers s n
eppppppppppppppppppc
... (3 Replies)
Discussion started by: kshitij
3 Replies
LEARN ABOUT OPENSOLARIS
igawk
IGAWK(1) Utility Commands IGAWK(1)
NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO
gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgawk |
+--------------------+-----------------+
|Interface Stability | Volatile |
+--------------------+-----------------+
NOTES
Source for gawk is available on http://opensolaris.org.
Free Software Foundation Nov 3 1999 IGAWK(1)