02-19-2010
Quote:
Originally Posted by
mhdmehraj
hi , thankz for ur reply ..
But i need to do the same with sed .
Why?
Is grep or awk not good enough or is this a homework question?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all!
Here is my problem : I have a string like the following :
20030613170404;BAN_CAV ; starting script Loader.sh on ; 13/06/2003 at ; 17;04;03
I want to eraze all characters located after "Loader.sh", because there are unuseful.
I tried to use sed...but it didnt work....i guess i... (1 Reply)
Discussion started by: HowardIsHigh
1 Replies
2. Shell Programming and Scripting
I have been reading through the sed one liners, trying to understand what is happening.
# delete the last 2 lines of a file
sed 'N;$!P;$!D;$d'
The above will delete the last 2 line of a file. I tried analyzing what happens. And I got lost :(
This is what I understood so far from the... (2 Replies)
Discussion started by: vino
2 Replies
3. UNIX for Dummies Questions & Answers
I think it should be obvious what I'm trying to do from my command, but just to be sure it's clear, I'm trying to append 2 lines after a matched line and then delete 2 other lines within a file. I'd like to do it in 1 line if possible.
This code isn't working, but hopefully it's just a syntax... (0 Replies)
Discussion started by: earnstaf
0 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I am very new to UNIX...
I was trying to delete ^ from a file and save it with different name...
The version is AIX 5.3
The input file is in this directory /a/b
The Input file name is o9876.out
I want the output file in same path with different name like ABC.txt... (5 Replies)
Discussion started by: us_pokiri
5 Replies
5. Shell Programming and Scripting
Guys,
file1:
test \
123
cat file1 | sed '/test \/d' ---- does not work
I have to remove the line "test \" in file1
can somebody help ? (7 Replies)
Discussion started by: giri_luck
7 Replies
6. Shell Programming and Scripting
Hi,
I have a text file with content as follows:
bla foo3200492
comment on this: 3900302
here comes the teddy 12
all I need is:
3200492
3900302
12
So I need the correct "sed" command to delete everything until the first number.
I am not a regex expert, because I have to... (3 Replies)
Discussion started by: mcW
3 Replies
7. Shell Programming and Scripting
I have tried doing this to delete some lines: sed '1,10d' file
Now I want to specify a variable as a line number for example:
lastline=wc -l file
linestart=$lastline - 20
sed '$linestart,$lastlined' file
but this will give error: sed: -e expression #1, char 3: extra characters after... (4 Replies)
Discussion started by: zorrox
4 Replies
8. Shell Programming and Scripting
Hi
I would like to delete ranges of text from an html file;
In the sentence; aqua>Stroomprobleem in Hengelo verholpen <a href="107-01.html"><font color=yellow>107</a>
With several sentences like this in that file, where the text between <a href a> varies, so it needs to be deleted in the... (2 Replies)
Discussion started by: mdop
2 Replies
9. Shell Programming and Scripting
I am not able to analyze the below code..
What I expected is that DELETED will be replaced with the first field in every line.But after giving a try, the output was different.
Can anyone pleas analyze and explain the code in detail?
Many thanks...
$ sed 's/* /DELETED /g' g1.txt > g4.txt... (2 Replies)
Discussion started by: giridhar276
2 Replies
10. Shell Programming and Scripting
I am trying to use sed to delete the ^M at the end of the line and when i pass a file './asciiFix.sh wintest.txt' I get an error saying sed: can't read : no such file or dir. Can someone give me a pointer as to what I am doing wrong?
#!/bin/sh
if file "$@" | grep "with CRLF"; then
echo... (5 Replies)
Discussion started by: kwatt019
5 Replies
LEARN ABOUT REDHAT
deleteln
curs_deleteln(3X) curs_deleteln(3X)
NAME
deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln - delete and insert lines in a curses window
SYNOPSIS
#include <curses.h>
int deleteln(void);
int wdeleteln(WINDOW *win);
int insdelln(int n);
int winsdelln(WINDOW *win, int n);
int insertln(void);
int winsertln(WINDOW *win);
DESCRIPTION
The deleteln and wdeleteln routines delete the line under the cursor in the window; all lines below the current line are moved up one line.
The bottom line of the window is cleared. The cursor position does not change.
The insdelln and winsdelln routines, for positive n, insert n lines into the specified window above the current line. The n bottom lines
are lost. For negative n, delete n lines (starting with the one under the cursor), and move the remaining lines up. The bottom n lines
are cleared. The current cursor position remains the same.
The insertln and winsertln routines, insert a blank line above the current line and the bottom line is lost.
RETURN VALUE
All routines return the integer ERR upon failure and an OK (SVr4 specifies only "an integer value other than ERR") upon successful comple-
tion.
PORTABILITY
These functions are described in the XSI Curses standard, Issue 4. The standard specifies that they return ERR on failure, but specifies
no error conditions.
NOTES
Note that all but winsdelln may be macros.
These routines do not require a hardware line delete or insert feature in the terminal. In fact, they won't use hardware line
delete/insert unless idlok(..., TRUE) has been set on the current window.
SEE ALSO
curses(3X)
curs_deleteln(3X)