Sorry All to disturb you again.
May be i m checking wrong. i need somthing like that.
I am using propety file as HandofValidation.property file which contains following data like
--The propety file has some constant which denotes that for EUR region 57 ~ count now from this the script should check whether in count.txt in row number 1 for EUR region ~ count are 57 are not if yes then check next row and so on.....
--Actually now my script gives proper result like in which line has more tilda than first row and gives an error line also .. But my boss want if first line has wrong ~ then my script will fail. So he want to keep all the constants in property file so that that count for perticular region can be take from property file.
--
--Below i am giving how i am using all the files you can give your idea on that.
--my script
-new.sh
--OPUTPUT
3
::INT:::::
Total lines 1
oldsum at last 52
::INT:::::
Total lines 2
Total lines::: 2
oldsum ::: 52
sum ::: 52
oldsum 52
::INT:::::
Total lines 3
Total lines::: 3
oldsum ::: 52
sum ::: 59
error in OPICS~CA~EOD~888~2010-10-01 01:01:29~20100930~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ at line 3 tilde count= 59
I need output like
above output but it should check variable value.
please suggest on my property file also. whether it is wrong or correct.
--Waiting for your reply.
Thanks & Regards
Ganesh
---------- Post updated at 02:34 PM ---------- Previous update was at 02:15 PM ----------
Hi pravin,
i am gettin following error after using your solution
grep: can't open .properties
awk: syntax error near line 1
awk: bailing out near line 1
--im using like ---------- Post updated at 03:56 PM ---------- Previous update was at 02:34 PM ----------
Hi Franklin,
this is not double post of my thread.The reply which i got according to that i replied on that comments.I thought My problem has not getting cleared so i posted in detail what i actually need. in the last thread i explained everything in detail so anybady can understand the proble and give a exact solution.Excuse me if i broke the ruls .Please keep my thread open so i can get correct solution.
Thanks & regards,
Ganesh
Last edited by vbe; 10-05-2010 at 09:58 AM..
Reason: please use code tags: in forum rules Additional helpful guidelines for all posters -point B
Hi Pravin,
Thanks for quick reply,
yes its working if i use "nawk" insted of "awk" but i have one more problem , As you see in properties file around 8 constants are there.
example.
INTELLECT_EUR_DEAL_FLD_COUNT=51
INTELLECT_EUR_CASHFLOW_FLD_COUNT=14
INTELLECT_TOK_DEAL_FLD_COUNT=57
INTELLECT_TOK_CASHFLOW_FLD_COUNT=14
INTELLECT_NY_DEAL_FLD_COUNT=51
INTELLECT_NY_CASHFLOW_FLD_COUNT=14
INTELLECT_CA_DEAL_FLD_COUNT=51
INTELLECT_CA_CASHFLOW_FLD_COUNT=14
then how to use these multiple constants in grep command so that no need to chang variable every tine in script , can we use variable over ther?
Thanks all for taking time out and reading this thread and big Thanks to all who have come forward for rescue.
Background: I have a variable "nbrofcols" that has number of columns from a data file. Now, using this count in for loop, I am trying to get the maximum length of each column present... (7 Replies)
Hi,
Was hoping someone could help with the following:
while read line; do pntadm -P $line | awk '{if (( $2 == 00 && $1 != 00 ) || ( $2 == 04 )) print $3,$5}'; done < /tmp/subnet_list
Anyone know if it is possible to assign $3 and $5 to separate variables within the {} brackets?
Thanks... (14 Replies)
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
HI,
This is the code I am using:
awk -v aaa="connect" 'BEGIN {IGNORECASE} /aaa/,/!/ {print NR}' bb
This does not throw any error but it does not work. Pls help
Thanks. (4 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)
I am trying to print the lines with pattern and my pattern is set to a variable express
awk '/$express/{where=NR;print}' test2.log
I am not getting any data even though i have the data with the pattern. Can seomeone correct me with the awk command above? (20 Replies)
Hi All,
I have awk script for replacing the nth ocurance of a string in an xml file...
My code is like this
FILETYPE=xml
TAGNAME=type
OCCURANCE=$1
TAGVALUE=valueur
echo OCCURANCE:$OCCURANCE
echo TAGNAME:$TAGNAME
echo TAGVALUE:$TAGVALUE
awk -v n=$OCCURANCE -v... (1 Reply)
i'm trying to do this (in bash darwin);
echo "give me some words: "
read a
c=2 # this is get by other ways
echo $a | awk '{print $c}' # i want to print the column given
# by de $c variable
if there is someone understand what i pretend... (3 Replies)