Annihilannic,
Thanks for your response.
I would like my script to be fully awk (Chris) for e.g.
Chris NE DT 20061105 20061106 and must read
BEGIN{for (i=1;i<ARGC;i++){
if(ARGV[i] != 4){
exit 1
}
else
{
if($1!=NE){
print something
exit 2
}
if($2!=DT){
print something
exit 3...
Hi All,
Can I use a for loop to read the ARGC input parameters instead of me using ksh to do this for e.g.
Chris.sh NE DT 20061105 20061106 and must read
BEGIN{for (i=1;i<ARGC;i++){
if(ARGV[i] != 4){
exit 1
}
else
{
$1=NE ,$2=DT etc..
}
Many Thanks
Chris
Hi All, PHV
How can I print the getline statement from the following:
awk -v opt=Restore_Chris -v PH='/raw_data/SB/repdir/Archive_Restore/'
'BEGIN{print "connect tcenh198 dsadmin \"\""}
/MTA0000001/{print "compRead...
Hi All, PHV
Below is my script that reads the .ini file and if the start time is 12:00 is should them activate
the instance which it does but due to the data base allready marked as active , it returns a "MESG"
But when the next instance (conductor_DCAPS_E10_12) is read it does the system...
Hi PHV,
As always spot on. One question , may I borrow your brain for one year, I promise to return it in the same order.(just a joke)
Many Thanks
Chris
Hi
Thanks once again. The result i am getting is incorrect
A_NUM DATE/TIME B_NUM DURATION
(0 rows affected)
awk 'BEGIN {printf "%10s %25s %20s %15s\n","A_NUM","DATE/TIME", "B_NUM","DURATION"...
Hi Feherke,
Thanks a lot. With you code I get the following error
syntax error The source line is 14.
The error context is
>>> END <<< {
awk: The statement cannot be correctly parsed.
CODE
====
awk 'BEGIN{printf "%10s %25s %20s %15s\n","A_NUM","DATE/TIME"...
Hi Feherke,
Thanks, but I have tried it
awk 'BEGIN{printf "%10s %25s %20s %15s\n","A_NUM","DATE/TIME", "B_NUM","DURATION"}
FNR==NR {
t[$1]=$1; next
}
{if(t[$1]==$1){Flag=1}{
if($4=="0" && ($4!="[A-Z,a-z] || $4!=\"---")){
DUR=$4...
Hi All,
The problem that I am experiencing is when the pattern is not found in file2,
print a mesg "0133333333 No Info Available". I have tried different ways but cannot
seem to find a solution.
My Code
awk 'BEGIN{printf "%10s %25s %20s %15s\n","A_NUM","DATE/TIME", "B_NUM","DURATION"}...
Hi All,
I have a solution but seems to be like PHV would call it 'BRUTE'
Da=`awk '{print $2" 00:00:00"}'`
and then
awk -v opt="/sybase_oc/OCS-12_0/bin/isql" -v opt2="'$Da'" '
{
.......
.......
}'
If any or better solution , please post
Many Thanks
Chris
Hi PHV,
Thanks once again. I did try you solution but this is what I get
echo select A_NUM=nullif\(A_NUM,\" \"\) from CE.CDR_DRMS where R_DT=date\(2006/06/06\) and A_1=0 and A_2=1 and A_3=2 and A_4=3 and A_5=1 and A_6=1 and A_7=8 and A_8=8 and A_9=6 and A_10=isnull\(5,\"\"\) \\ngo |...
Hi All,
How can I call a sprintf command to read the following
selcmd1=sprintf("%s","echo select A_NUM=nullif\(A_NUM,\\\" \\\"\) R_DT=date\('2006/06/06'\) "\\\\ngo | " opt)
in other words the result must return like :
echo select A_NUM=nullif\(A_NUM,\" \"\) where R_DT=date\('2006/06/06'\)...
Hi PHV,Feherke
Thanks.
PHV's solution is perfect (as always, right).
Feherke
Your solution does work but does not assign to each array.
Many Thanks
Chris
Hi Feherke,
Thanks for your input but I dont get the results
File
====
0123456789 2006/06/06
awk '{ len=length=$1
dim=split($1,arr,"")
for (i=1;i<=dim && i < len;i++)
print i,":",arr[i]
}' File
Output should look like this
arr0=0
arr1=1
arr2=2
etc..
What am I...
Hi All,
How can I do the following
number = 0123456789
By using the for loop
for (i=0;i<=length($1);++i)
{
assign each number to an arr
} ' $1
and the result
arr1=0
arr1=1
arr1=2
arr1=3
arr1=4
arr1=5
arr1=6
arr1=7
etc...
Many Thanks
Chris
Hi Salem,
I might be missing your point. When we first read the byte it is in char format "&" and when converted it is 26 and so this applies for the next byte "ac", so I cannot see how you would pass it as an int. Should I not convert it to hex or straight into int then only times it by 256...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.