After lot of trial and error I am really bowled out with the requirement in hand and honestly you are my last hope
Here is what I want to achieve
Values
I need to fill a variable with the following information
if GT or GE string is found then fill with the corresponding next number for example 70.00 for first line 500 for second line 90.0 for thirdline
Sixth line has two GE so fill with 80.00,10 that is the one which is first occurence [comma] second occurrence
There will be lines which doesn't have *GE or *GT fill nothing
Here is what I could achieve till now
formula is a variable which contains the line one by one above in a for loop
Obviously the above line is not fetching me the right results as i would like to have
Note this is part of a huge script. I cannot change the scriptling language now
Not completly sure but if you need values of string GE and GT then could you please try following and let me know if this helps, I have taken values of GE and GT as follows.
Output is as follows:
For GT values:
Output will be as follows.
Here it is giving line number and then value of string next to it, also if there are more than a single occurance of words it is taking them into a single line. Kindly let me know additional details with complete input like how you are going to use it, will be helpful for us to advise you.
EDIT: Also you can remove the highlighted code and it wouldn't show you the line number which I added to just make sure
all same line's values are on same line.
Thanks,
R. Singh
Last edited by RavinderSingh13; 01-12-2015 at 06:43 AM..
Reason: Added a note to remove line numbers if happy with
Thank you R. Singh. That is hell of a code. Almost what I need.
I need GT and GE to be listed together and not separately that is if the code sees GT or GE just pick up the value next to it. If it sees both pick both
A line can be there where we will have *GE and *GT in same formula. Pick both in same variable $valueGreater with a space is OK
---------- Post updated at 07:21 AM ---------- Previous update was at 07:10 AM ----------
Quote:
Originally Posted by disedorgue
Hello,
You can try:
Regards
Almost works perfectly for
But fails on
Last edited by radioactive9; 01-12-2015 at 08:48 AM..
Thank you R. Singh. That is hell of a code. Almost what I need.
I need GT and GE to be listed together and not separately that is if the code sees GT or GE just pick up the value next to it. If it sees both pick both
A line can be there where we will have *GE and *GT in same formula. Pick both in same variable $valueGreater with a space is OK
Also don't want that 1 2 3 at the start
---------- Post updated at 07:21 AM ---------- Previous update was at 07:10 AM ----------
Almost works perfectly for
But fails on
Hello radioactive9,
Could you please try following and let me know if this helps, hope this will(But not tested code though).
Thanks,
R. Singh
Thank you R. Singh. That is hell of a code. Almost what I need.
I need GT and GE to be listed together and not separately that is if the code sees GT or GE just pick up the value next to it. If it sees both pick both
A line can be there where we will have *GE and *GT in same formula. Pick both in same variable $valueGreater with a space is OK
Also don't want that 1 2 3 at the start
---------- Post updated at 07:21 AM ---------- Previous update was at 07:10 AM ----------
Almost works perfectly for
But fails on
With this modification, it works better:
This User Gave Thanks to disedorgue For This Post:
hi all i have a reporting work and i want it to be automated using shell scripting kindly let me know how can i make that possibe .
eg data are :... (2 Replies)
:wall:
Hi
I am a newbie with Shell Scripting who stuck while creating a shell script for Pythagoras theorem.I need to know how to add the squares for the value in shell scripting(for eg: b2 =a2 +c2).
Thanks
VR (4 Replies)
hey i am using this code to connect to sql , store the value in variable and then
compare it with another variable after some time by executing the same query
but the desired result is not coming
#!/bin/bash
val=$(sqlplus -s rte/rted2@rel76d2 <<ENDOFSQL
set heading off
set feedback off... (11 Replies)
hi
My script as below
#!/bin/ksh
for i in `seq 1 7`
do
a=$(awk '{print $i}' /home/rama/expenese.txt)
done
for i in `seq 1 7`
do
echo "${a}"
done
content of expense.txt is as below
5032 210179 3110 132813874 53488966 11459221 5300794
I want output as... (6 Replies)
Hello,
I don't have experience in this scripting and I need some help to read a value from an XML file and change it with a random number to use in simulator for different network scenarios.
</Description><sim_comm_rounds>35</sim_comm_rounds><num_clusters>1</num_clusters><Clocking>
I want to... (5 Replies)
Dear Guyz:)
I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z).
I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Hi All,
I want to concatenate the array cell values and form a string.. Is it possible?
for ex.
I have an array
word_array contains d u m b and after concatenating the string shld be 'dumb'
thanks (2 Replies)
has anyone got any suggestions how i would pick up the string as part of a substitution inclusive of the carriage return.
ie
i want to pick up <<NAME>> from the PS output but the <<; seems to be on the line before the NAME.
Any ideas are appreciated!
... (3 Replies)