10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
2. UNIX for Beginners Questions & Answers
Hi all,
I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex:
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
3. Shell Programming and Scripting
Hi,
I have a file with the content:
for name in \
sree\
rama\
laila\
srihari\
vicky\
john
do
echo $name
done
I need to remove all the name lines that exist between for (first line) and do line so that i can replace with new names.
Output file should look like: (3 Replies)
Discussion started by: raosr020
3 Replies
4. Shell Programming and Scripting
I want to delete 1 line above the paatern and 3 lines below the pattern and the pattern line itself, on the whole 5 lines. If there are three patterns to be deleted what to do and the final text file to be captured in a new file. (1 Reply)
Discussion started by: razen
1 Replies
5. Shell Programming and Scripting
hi,
Here is excerpt from my xml file
<!-- The custom module to do the authentication for LDAP
-->
</login-module>
<login-module code="com.nlayers.seneca.security.LdapLogin" flag="sufficient">
<module-option... (1 Reply)
Discussion started by: sunrexstar
1 Replies
6. Shell Programming and Scripting
hi,
I have the following file
hello
world
this
is
to
say
bye
to
everyone
so
bye
I want to get the lines from hello to the first bye inclusive into another file?
how can I do this (11 Replies)
Discussion started by: JamesByars
11 Replies
7. Shell Programming and Scripting
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Discussion started by: toms
4 Replies
8. Shell Programming and Scripting
Hi All,
I have written the below script that searches for the pattern in a file and delete them if present. please can some one have a look and suggest the changes in the script.
#!bin/sh
# The pattern that user want to add to the files
echo "Enter the pattern of the redirect"
read... (4 Replies)
Discussion started by: Shazin
4 Replies
9. Shell Programming and Scripting
I want to delete lines like this
sed '/FROM_HERE/,/TO_HERE/d'
but I would like to *not* delete the second match, i.e. the TO_HERE line. How can I achieve this?
Thank you! (1 Reply)
Discussion started by: Ilja
1 Replies
10. Shell Programming and Scripting
Hi,
I need to create a script that does the following:
1. Read the file for the occurrences of "EXECUTE" and "END" strings.
There will be several occurrences of EXECUTE and END strings on the file.
2. The resulting lines in #1, needs to be searched for the word... (11 Replies)
Discussion started by: racbern
11 Replies