11-29-2011
this can help you..
Quote:
sed 's/The quick brown fox/Then the quick onyx goblin/g' <filename
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Howdy!
I'm trying to automate editing of a configuration file (custom.conf for GDM). I need to find every line between a line that starts with "" and the next line that starts with "", I want to preserve that line, but then delete all the lines in that configuration section and then insert... (3 Replies)
Discussion started by: TXTad
3 Replies
2. Shell Programming and Scripting
Hi,
I have a situation where I want to replace some occurrences of ".jsp" into ".html" inside a text file.
For Example:
If a pattern found like <a href="http://www.mysite.com/mypage.jsp"> it should be retained.
But if a pattern found like <a href="../mypage.jsp"> it should be changed to... (4 Replies)
Discussion started by: meharo
4 Replies
3. Shell Programming and Scripting
Hello,
file1:
not to be changed
not to be changed
<start>
old stuff
old stuff
old stuff
<end>
not to be changed
not to be changed
file2:
new text
new text
desired output: (3 Replies)
Discussion started by: ripat
3 Replies
4. Shell Programming and Scripting
can anyone please help me in the below scenario:
File1:
Hello1
Hello1
i want to use sed to replace multiple occurances of Hello1 in file 1 to welcome.
Thanks a ton for the help (9 Replies)
Discussion started by: amithkhandakar
9 Replies
5. Shell Programming and Scripting
Hello, guys!
"filename" has blocks with three lines each in this fashion:
93909286
#verified
has one bug
10909286
#unverified
pending
10909286
#unverified
pendingThe above example has duplicate blocks, and I have tried using sed to remove just one block... The... (2 Replies)
Discussion started by: teresaejunior
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I would like to use sed to replace NA to x ('s/NA/x/g'), but only in the 5th column of the space delimited text file, nowhere else. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I want to use sed to replace " /// " with "///" in a text file. However I am getting error messages when I use sed 's/ /// /////g' input.txt > output.txt. How do I go about doing this in sed?
Input:
219518_s_at 0.000189 ELL3 / SERINC4
Output:
219518_s_at 0.000189 ELL3/SERINC4 (5 Replies)
Discussion started by: evelibertine
5 Replies
8. Shell Programming and Scripting
I have a sample text format as given below
<Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text>
<Text Text_ID="10155645315851111_10155645317023456" From="1626711840902323"... (3 Replies)
Discussion started by: my_Perl
3 Replies
9. Debian
Good Day Every one
I have a problem finding and replacing text in some large files that will take a long time to manually edit.
Example text file looks like this
#Example Large Text File
unix
linux
dos
squid
bind
dance
bike
car
plane
What im trying to do is to edit all the... (4 Replies)
Discussion started by: linuxjunkie
4 Replies
10. UNIX for Beginners Questions & Answers
Hello Everyone,
I have many files like so:
file1.txt
file2.txt
file3.txt
Within each file I have many lines of random text separated by commas like so:
abcAAA,123,defAA,456777,ghiA,789
jklB,101,mnoBBB,11211,pqrB,13111
stuCC,415,vwxCCCC,161,yzaC,718
I am trying to use SED or AWK to... (4 Replies)
Discussion started by: D3U5X
4 Replies
LEARN ABOUT HPUX
dteditorappend
DtEditorAppend(library call) DtEditorAppend(library call)
NAME
DtEditorAppend -- append data to a DtEditor widget
SYNOPSIS
#include <Dt/Editor.h>
DtEditorErrorCode DtEditorAppend(
Widget widget,
DtEditorContentRec *data);
DESCRIPTION
The DtEditorAppend function appends either a NULL-terminated string, wide character string or sized buffer after the last character in a
DtEditor widget. The data is transferred to the DtEditor widget using a DtEditorContentRec, which indicates the type of data being trans-
ferred along with the actual data. After the data is appended, the insertion cursor is positioned at the new last character.
The widget argument specifies the DtEditor widget ID.
The data argument points to the data structure containing the data to append.
For a complete definition of the DtEditor widget and its associated resources, see DtEditor(3).
For a complete definition of DtEditorContentRec, see Dt/Editor.h - DtEditor(5).
RETURN VALUE
Upon successful completion, the DtEditorAppend function returns one of the following values:
DtEDITOR_NO_ERRORS
The data was appended sucessfully.
DtEDITOR_NULLS_REMOVED
NULL characters were found and removed from the data.
Otherwise, if the DtEditorAppend function cannot append the data into the DtEditor widget, it returns one of the following values:
DtEDITOR_INVALID_TYPE
The type field is unrecognized.
DtEDITOR_ILLEGAL_SIZE
The size of the buffer passed in is negative.
DtEDITOR_NULL_ITEM
The buffer is NULL.
DtEDITOR_INSUFFICIENT_MEMORY
Not enough system memory is available to append the data.
EXAMPLES
The following code segment sets the contents of a DtEditor widget to ``The quick brown fox.''
Widget editor;
DtEditorContentRec cr;
DtEditorErrorCode status;
char *sampleString1="The quick",
*secondString2=" brown fox";
cr.type = DtEDITOR_TEXT;
cr.value.string = sampleString1;
status = DtEditorSetContents(editor, &cr);
if (status != DtEDITOR_NO_ERRORS && status != DtEDITOR_NULLS_REMOVED) {
printf("Unable to set the contents of the widget
");
} else {
cr.type = DtEDITOR_TEXT;
cr.value.string = sampleString2;
status = DtEditorAppend(editor, &cr);
if (status != DtEDITOR_NO_ERRORS)
printf("Unable to append to the contents of the widget
");
}
APPLICATION USAGE
If the data is in a disk file, rather than in memory, the application should use DtEditorAppendFromFile(3).
SEE ALSO
Dt/Editor.h - DtEditor(5), DtEditor(3), DtEditorAppendFromFile(3), DtEditorGetContents(3), DtEditorInsert(3), DtEditorInsertFromFile(3),
DtEditorReplace(3), DtEditorReplaceFromFile(3), DtEditorSaveContentsToFile(3), DtEditorSetContents(3), DtEditorSetContentsFromFile(3).
DtEditorAppend(library call)