Hi All,
How can i use the file for printing in awk
file1
----------
update table crn_ras_disc_dtl a set a.a5=$1,a.a1=$2,a.a2=$3,a.a3=$4,a.a4=$5;
file2
--------
10|KUMAR|23|MALE|US
20|RAJ|24|MALE|AU
Output
---------
update table crn_ras_disc_dtl a set... (12 Replies)
line_no=6
echo 'Phone,' `awk 'NR==$line_no{print;exit}' <filename>`
what is the error in this..
it says..
awk: Field $() is not correct.
The input line number is 1. The file is <filename>.
The source line number is 1.
i want to print the data in the $line_no line of a certain... (2 Replies)
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
I have 3 files and each contain m*n matrix.
m = number of rows (horizontal lines)
n = number of columns (entries in a particular line)
What I wish to find is the sum of the 2nd number in the last row.
Ex
file1.dat
2 5 8 8
4 6 7 8
3 8 3 7
file2.dat
3 4 1 4
8 4 0 3
4 7 3 7
... (3 Replies)
Hi,
I am trying to do the following thing
var='date'
$var
Above command substitutes date for and in turn runs the date command and i am getting the todays date value.
I am trying to do the same thing as following, but facing some problems,
unique_host_pro="sed -e ' /#/d'... (3 Replies)
How do you use a shell variable in awk? I am using Solaris 10 and don't have GNU products installed.
File (transportation.txt) contents:
car
boat
airplane
snowmobile
bicycle
sled
This awk statment works (prints from the car line down to bicycle
awk '/car/,/bicycle/'... (8 Replies)
I am reasonably capable with awk and its quirks, but not with shell weirdness. This has to be Bourne Shell for portability reasons. I have an awk program that is working just fine; it handles multiple input streams and produces several reports, based on the request (-v Variables). In addition... (3 Replies)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Hello, there!
I am trying to pass an awk variable into a shell command in order to collect the result into an awk variable; in Bash it does work, as in:
v='2'; date -d "now + $v weeks"
But in awk it does not, as in:
v="2"
"date -d 'now + v weeks'" | getline newdate
close ("date -d 'now... (3 Replies)