10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear all,
I face a problem I can not solve: I have different lines in a file and some of them are ending with ie "\r\n" and the others are ending with "\n".
My aim is to supress the string "\r\n" and concatenate that line with the following one.
For example:
Saying I have a file... (4 Replies)
Discussion started by: dae
4 Replies
2. UNIX for Dummies Questions & Answers
Hi
I am looking for the way to delete the block of data for example
original file
line1
line2
line3
line4
line5
input file
line2
line3
original file should contain
line1
line4
line5 (3 Replies)
Discussion started by: rakeshkumar
3 Replies
3. Shell Programming and Scripting
example.txt
----------
this is a line i want to keep
this is another line I wish to keep
I wish to delete from here ON until I see
four new lines from here and then
I wish to keep the rest.
These are some special charcters {)#@ which
have to be deleted too
This is a one more new line... (4 Replies)
Discussion started by: jville
4 Replies
4. Shell Programming and Scripting
Hi all,
First off, Thank you all for the knowledge I have gleaned from this site!
Deleting Records from a text file... sed paragraphs
The following code works nearly perfect, however each time it is run on the log file it adds a newline at the head of the file, run it 5 times, it'll have 5... (1 Reply)
Discussion started by: Festus Hagen
1 Replies
5. Shell Programming and Scripting
Hi All,
Please can anyone help me as am deleting a line in a file with the below script:
sed '/"$value"/d' redirects.virgin-atlantic.com.conf > olist
where $value is a variable where the pattern to be matched is stored.
I am not getting any error also but the line containing the pattern... (2 Replies)
Discussion started by: Shazin
2 Replies
6. Shell Programming and Scripting
FileA
NAME STATE CITY
---- ---- -----
abc ca ca
bcc ny ny
def nj nj
(3 rows affected)
Q1) I want to delete the second row with is ---- ---- -----.
Can delete 2nd row using following
sed '2d' FileA >FileB
but incase the second record is not ---- ---- -----.
then data will... (3 Replies)
Discussion started by: pinnacle
3 Replies
7. Shell Programming and Scripting
An ldif export needs some text removed from every line with a ; and :
Only the text (including the ;) from the ; to the : (but not the :) needs to be removed.
thoughts?
here's an example of one record:
dn: cn=me,ou=groups,dc=me,dc=com
nsUniqueId: 1255060a-46e511dd-803ce5f5-385faa0b... (1 Reply)
Discussion started by: rfransix
1 Replies
8. Shell Programming and Scripting
I take the /etc/passwd file and print it out, but I only want the lines that end with sh.
I have
cat /etc/passwd | sed '/sh/!d' Which prints out all lines that have sh somewhere in it.
So I added $, which I thought matches the ends on lines, but its not working, like for example I have have... (5 Replies)
Discussion started by: Bandit390
5 Replies
9. Shell Programming and Scripting
Need to delete a text block inside a file, that is marked with a start and an end pattern. Eg
do not delete
not delete
<tag1>
delete everything here
here
and here
and here...
<tag2>
do not delete
do not delete....
Believe sed is able to do this job but don't get it working.
... (1 Reply)
Discussion started by: andre123
1 Replies
10. Shell Programming and Scripting
Hi,
In my korn shell script, I want to delete some particular text from a certain file...How can this be done? Is the below right?
ed $NAMES << EOF
echo "" > /dev/null
echo "${x} = " > /dev/null
echo "name = " > /dev/null
echo "adress = " > /dev/null
w
q
EOF (1 Reply)
Discussion started by: n8575
1 Replies