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 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,
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 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 and all,
How can I cat two bytes which is read in as char and then converted in hex, for e.g.
If I read the first byte (char) and then covert it to hex (26), read
the next char and convert it to hex (ac). Cat the both should be 26ac , then only
print the decimal value.
Is my logic...
Hi All,
I am new with c and would like some help.
When reading a bin file the year is 06, the decimal value = 6 so I use the &rawtime to determine the year and then
cat it with the array (xya[j]) so that the result will printf 2006 and do this with the month as well as the day.
How can I strcat...
Hi All, PHV
I am stuck with the following or if there is a better solution please post.
What I am trying to achive is to read a bin file with "od"
0000000 4837 7470 722b 3a30 3964 7331 3753 4654
0000020 3030 3030 6161 6161 6161 6161 6161 6161
0000040 6161 6161 6161 6161 6161 3781 0000 0000...
Hi all,
In order for me to complete or ask any questions with my script, I was wondering weather awk
can read a bin file, just like perl can using the "open" cmd and if so how can this be done.
Many Thanks
Chris
Hi All, PHV
What I need is to find a pattern 128 then count 32 lines read $2 which is 20060212092325
prompt the user to which date would he like to change to, change the date to the reply but
at the same time read reply then substr date into :
Y_R=substr(reply,1,4)...
Hi All,
Below is the code which I am busy with but am stuck with trying to read the third file.
What I would like to do is to use (this value------->) as indicated below and sub into the third file
Can anyone assist me with this issue.
awk 'FNR==NR {...
Hi All,
How can I compare two files for eg if line in filea is not in fileb print "filea Diff in" and if line in fileb is not in filea print "fileb Diff in". The below code will work if I put fileb as the first file and filea as the second
awk '
NR==FNR{a[$0];next}
{if...
Hi,
Below is my code which the output I receive is not what I expect. What I need help in is when
/[a-z]:/ is not found print a mesg and then exit or else if pattern is found, print certain columns as required.
awk '{if(!~/:/){
print "No Errors were Found for `date +'%Y%m%d'`"
}
else
{...
Hi All,
Is there a way in which AWK reads two files, get a result from each file, and then subtracts file1 result from file2 result.
e.g.
x=/= "RM_[0-9][0-9][0-9][0-9][0-9]/{print substr($3,2,10),substr($3,7,5)}' from file1
y={if($1~/^IP/ && $9~/M_[0-9]/){print...
Hi All,
Below is a script from CaKiwi,
If I am reading a file that is dated 20041225 with Julian date 360, which uses the current year (2005) to determine if it is a leap year("date +'%Y'" | getline yy), and then returns the wrong date format which I understand why this is being done.
My...
Hi All
Is there any explanation as to why the SQL1 statement (substr) takes longer than the SQL2 statement?
They are both index the same.
SQL1
select count(*) from CE.CDR_DRMS
where substr(FE_F,9,8) >= '20041001' and substr(FE_F,9,8) <= '20041001'
and STAT_CODE like 'r%';
SQL2
select...
Hi All,
I have two files.
First file "Chris1.txt"
ckb+:05 17468668 ds09
ckb+:05 1549368 ss09
cup+:03 3654311 ds09
cup+:03 266059 ss09
eel+:04 15392852 ds09
eel+:04 944131 ss09
Second File "Chris2.txt"
ckb+:05...
Hi All,PHV,
Below is a script which PHV assisted me with. My question is what if the file does not constist of /^128 A/, it should exit with a print statement.
My suggestion is to getline (first line), if $0!~/ AT 1.1 LV 1.1 then exit. Check if output file is "-s" and if not true, use the rm...
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.