I have different strings (SQL queries infact) of different lengths such as:
I need to find out the word coming after the word "FROM" in a shell script. For this I am able to find the location of word "FROM". How can I find out the word at a location = location of word "FROM" + 1 ?
Is there any better alternative for achieving purpose other than finding out locations of words?
TIA
Last edited by vgersh99; 09-14-2009 at 09:49 AM..
Reason: code tags, PLEASE!
---------- Post updated at 08:49 AM ---------- Previous update was at 08:49 AM ----------
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
Hello All,
Since i'm relatively new in shell script need your guidance.
I'm copying files manually based on a specific word in a file name and its extension and then moving it into some destination folder.
so if filename contains hyr word and it has .md and .db extension; it will move to TUM/HYR... (13 Replies)
I have a big file having 100 K lines.
I have to read each line and see at 356 character position whethere there is a word "W" in it. If it is their then don't delete the line otherwise delete it.
There are two lines as one Header and one trailer which should remain same.
Can somebody... (5 Replies)
Hi friends,
I have one XML file having below structure :-
INput XML file :-
<?xml version="1.0" encoding="UTF-8"?>
<START>
<A=value1>
<attr name1="a1">
</A>
<B=value2>
<attr name2="b1">
<attr name3="c1">
</B>
</START>
output xml file should be
=== (3 Replies)
I'm try to change a the prohibit to aix for the lines starting with ssh and emagent and rest should be the same. Can anyone please suggest me how to do that using a shell script or sed
passwd account required /usr/lib/security/pam_prohibit
passwd session required ... (13 Replies)
Hey guys,
I'm a new bee to this forum as well as to Unix, just having a requirement which i'm not sure how to write shell script for it..
Here is my requirement
This is related to tomcat catalina.out file. Just want to display the content of this file until it finds a word like 'server... (2 Replies)
Hi,
I am trying to develop a script which should find a word if a particular word exists.
Below is the content of the file.
insert_job: test_job ----> job name
days_of_week: all
start_times: "16:00"
date_conditions: 1
insert_job: test_job2 ----> job name
days_of_week: all... (16 Replies)
I'm a relative newbie and apologize if this is silly... Suppose I have a file with English words and their Spanish translations. I read them in like this:
while(getline < myfile > 0) {
eng = $1
SPAN = $2
}
Now, for every eng in SPAN, I want to scan through SPAN and search for a... (2 Replies)
eg .
i have file x.txt contains :
java coding , shell scriptting etc...
now i want to add "is langauge" after word java.
output should be
java is langauge coding , shell scriptting etc...
any idea how to use shell script to do it ? (10 Replies)
How to use instr function in awk ?
to get the location
a) for example instr('productiondata_12','data',1) to get the location of data using awk.
b) for example instr('sampledata_rev_12','rev',1) to get the location of data
and reaplce with "org" using awk.
can anyone help
... (3 Replies)