10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
This is an extract from a large file. The lines that start with fc are ports on a fabric switch. In between each fc port there is information about the port.
fc2/12 is up
Port description is SEIEDISCOVER-3
Speed is 4 Gbps
fc2/13 is down (Administratively down)
fc2/14 is up
Port... (1 Reply)
Discussion started by: kieranfoley
1 Replies
2. Shell Programming and Scripting
Gents,
I am trying to delete all lines which start with "H" character, but keeping the fist header. Example In the input file I will delete all lines starting from line 8 which contents character "H" to the end of the file.
I try
sed '8,10000{/^H/d;}' file
But as don't know the end... (1 Reply)
Discussion started by: jiam912
1 Replies
3. UNIX for Dummies Questions & Answers
Dear everyone,
I have a file with 900 lines (there is only numbers in one line, no string),
I only need the lines 2+3n (n=0,1...296), i.e line 2, 5, 8, 11...888.
I tried google but only the results such as how to delete all the odd lines or all the even lines with 'awk' command.
Thanks in... (4 Replies)
Discussion started by: phamnu
4 Replies
4. Shell Programming and Scripting
Hi all,
I hope an expert tells me that there is a way to get ride of the certain lines in my files which have no specific string on them but fixed length.
It's the original pattern:... (9 Replies)
Discussion started by: GoldenFire
9 Replies
5. Shell Programming and Scripting
Hello.
My file is like this:
a
b
c
d
e
f
g
h
i
I want to delete all lines after the 3rd line, means after the "c". Is there any way to do this? The lines differ between them and the lines I want to delete does not have a specific word, or the lines I want to keep (a,b,c) does not have a... (4 Replies)
Discussion started by: hakermania
4 Replies
6. Shell Programming and Scripting
Let's say we have a file containing:
alllllsadfsdasdf
qwdDDDaassss
ccxxcxc#2222
dssSSSSddDDDD
D1Sqn2NYOHgTI
Hello
Alex
ssS@3
Ok, and let's say we want to delete all words from D1Sqn2NYOHgTI and back, this means
to delete the words (and the lines of them) :
alllllsadfsdasdf... (2 Replies)
Discussion started by: hakermania
2 Replies
7. Shell Programming and Scripting
I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it.
For example, Here is a portion of a zone file.
IN NS ns1.domain.tld.
IN NS ns2.domain.tld.
IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies
8. Shell Programming and Scripting
Hi
I want to extract certain text between two line numbers like
23234234324 and
54446655567567
How do I do this with a simple sed or awk command?
Thank you.
---------- Post updated at 06:16 PM ---------- Previous update was at 05:55 PM ----------
found it:
sed -n '#1,#2p'... (1 Reply)
Discussion started by: return_user
1 Replies
9. Shell Programming and Scripting
Hi,
I have a file ( all_users.ldif ) of the following format:
cn=orcladmin, cn=Users, dc=maximus,dc=com
cn=PUBLIC, cn=Users, dc=maximus,dc=com
cn=portal,cn=users,dc=maximus,dc=com
cn=portal_admin,cn=users,dc=maximus,dc=com
cn=uddi_publisher,cn=Users,dc=maximus,dc=com... (4 Replies)
Discussion started by: itzz.me
4 Replies
10. Programming
Hi, experts,
I would like to create a function that can calculate the total number of lines in a saved text file and delete specific lines in that particular file (I only want the last few lines). Hav anybody have the experience and giv me a hand in this? (9 Replies)
Discussion started by: dniz
9 Replies