10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file
Line 1 a
Line 22
Line 33
Line 1 b
Line 22
Line 1 c
Line 4
Line 5
I want to delete all lines before last occurrence of a line which contains something which is defined in a variable. Say a variable var contains 'Line 1', then I need the following in the output.
... (21 Replies)
Discussion started by: Soham
21 Replies
2. Shell Programming and Scripting
Hi Team,
Could someone please help me on this ..
While doing my day to day activity I use to delete manually the repeated ones ..
For example 05 & 06 are my hosts.. Now I need to print only 05 and 06, 05-06 is not required.
This is how I generate my report daily ..
DBG-STG1-05... (5 Replies)
Discussion started by: Nallachand
5 Replies
3. Shell Programming and Scripting
I had a spot of trouble coming up with a title, hopefully you'll understand once you read my problem... :)
I have the output of an ldapsearch that looks like this:
dn: cn=sam,ou=company,o=com
uidNumber: 7174
gidNumber: 49563
homeDirectory: /home/sam
loginshell: /bin/bash
uid: sam... (2 Replies)
Discussion started by: samgoober
2 Replies
4. Shell Programming and Scripting
I have a string in which i need to match a pattern and then i need to delete that line which contains that matching string.
The string is ..
This is the given string
//abc/def/IC.5.4.3/test/...
i need to match //abc
I am writing like this
sed '/^/\/\abc/d' but it is not giving me... (4 Replies)
Discussion started by: codecatcher
4 Replies
5. Shell Programming and Scripting
Hello sed gurus. I am using ksh on Sun and have a file created by concatenating several other files. All files contain header rows. I just need to keep the first occurrence and remove all other header rows.
header for file
1111
2222
3333
header for file
1111
2222
3333
header for file... (8 Replies)
Discussion started by: gary_w
8 Replies
6. Homework & Coursework Questions
if the given pattern exists in the file with the very next line starting and ending
with the same pattern , delete the line that starts and ends with the given pattern.
So upon running on this file
=====================
hai people<PATTERN> we had
<PATTERN>a lot of fun<PATTERN>
... (1 Reply)
Discussion started by: jacky29
1 Replies
7. Shell Programming and Scripting
Hi,
I have a data in a file like below -
andy 22 abc 30000 wallstreet
paul 30 xyz 40000 martstreet
john 35 abc 50000 martstreet
I want to search number of employees working in a particular company. Below query executes perfectly -
awk '/abc/{ COUNT ++; }END { print "number of... (3 Replies)
Discussion started by: shell123
3 Replies
8. Shell Programming and Scripting
Hi,
Before insert, delete everything. If ' available before insert, then we need to keep this.
Input:
====
l_s := ' INSERT INTO TEST1'
INSERT INTO TEST2
Output:
====
'INSERT INTO TEST'
INSERT INTO TEST2 (2 Replies)
Discussion started by: saurabhbaisakhi
2 Replies
9. Shell Programming and Scripting
Hi All,
Below is my requirement. Whatever coming in between ' ', needs to delete.
Input File Contents:
==============
This is nice 'boy'
This 'is
bad
boy.' Got it
Expected Output
===========
This is nice
This
Got it (4 Replies)
Discussion started by: susau_79
4 Replies
10. Shell Programming and Scripting
Hi,
I have file 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433... (4 Replies)
Discussion started by: imas
4 Replies