As this is an XML file, I'm not sure one can assume that the text 'kw01' is going to appear on a line by itself. You are, after all, replacing the entire line with the contents of the file.
Consider the following pseudo input:
It would be better to get AWK to replace just the text 'kw01' and not any surrounding characters. This can be achieved as follows, assuming the text file is called 'kw01.txt':
Best regards,
Mark.
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
Hi There...
I need to serach and replace strngs in a text file.
My file has;
books.amazon='Let me read'
news.bestseller='xyz'
expected output is
books.amazon=NONFOUND
news.bestseller=NONFOUND
Can I first find the text between string1= books.amazon=' and string2= ' (locate the text... (1 Reply)
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ?
The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories.
So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Please I want to replace all the contents beween "Section" and "Ensection" in file1 with all contents in file2. Example:
file1:
Section "Screen"
DefaultDepth 24
SubSection "Display"
Depth 8
ViewPort 0 0
Modes "1024x768" "800x600" "640x480"
EndSubsection
SubSection "Display"
Depth... (9 Replies)
Hi i am having XML file with many number of lines,I need to replace between two strings with .txt file using awk.
For ex
<PersonInfoShipTo ------------------------------ />
My requirement is to replace the content between
<PersonInfoShipTo ------------------------------ />
help me.
Thanks... (9 Replies)
Hi,
following Perl code i used for finding multiple strings and replace with single string.
code:
#!/usr/bin/perl
my @files = <*.txt>;
foreach $fileName (@files) {
print "$fileName\n";
my $searchStr = ',rdata\)' | ',,rdata\)' | ', ,rdata\)';
my $replaceStr =... (2 Replies)
Hello,
I have two files: file1 and file2
file1 has the following info:
---
host: "localhost"
port: 3000
reporter_type: "zookeeper"
zk_hosts:
- "localhost:2181"
file2 contains an IP address (1.1.1.1)
What I want to do is replace localhost with 1.1.1.1, so that the... (4 Replies)
Hello Guys,
I need to replace a string with multiple lines.
For eg:-
ABC,DEF,GHI,JKL,MNO,PQR,STU
need to convert the above as below:-
ABC,DEF,
GHI1
GHI2
GHI3,
JKL,MNO,
PQR1
PQR2
PQR3,
STU
i have tried using code as:- (2 Replies)
Discussion started by: jassi10781
2 Replies
LEARN ABOUT X11R4
wrjpgcom
wrjpgcom(1) User Commands wrjpgcom(1)NAME
wrjpgcom - insert text comments into a JPEG file
SYNOPSIS
wrjpgcom [-replace] [-comment text] [-cfile name] [filename]
DESCRIPTION
wrjpgcom reads the named JPEG or JFIF file, or the standard input if no file is named, and generates a new JPEG or JFIF file on the stan-
dard output. A comment block is added to the file.
The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. Although the standard does not actually define the intended
function of COM blocks, they are widely used to hold user-supplied text strings. This enables you to add annotations, titles, index terms,
and so on to your JPEG files, and later retrieve the COM blocks as text. COM blocks do not interfere with the image stored in the JPEG
file. The maximum size of a COM block is 64K, but you can have many COM blocks in one JPEG file.
wrjpgcom adds a COM block, containing text that you provide, to a JPEG file. Ordinarily, the COM block is added after any existing COM
blocks, but you can delete the old COM blocks if you wish.
OPTIONS
The following options are supported:
-cfile name Read the text for a new COM block from the named file.
-comment text Supply the text for a new COM block on the command line.
-replace Delete any existing COM blocks from the file.
OPERANDS
The following operands are supported:
filename The name of the JPEG file to which you want to add text comments.
EXTENDED DESCRIPTION
To add only one line of comment text, use the -comment option to provide the text on the command line. Specify the comment text within
quotes, so that the text is treated as a single argument. Longer comments can be read from a text file.
If you specify neither the -comment nor the -cfile option, wrjpgcom reads the comment text from standard input. In such cases, you must
supply an input image filename. You can enter multiple lines, up to 64KB. Type an end-of-file indicator, usually Ctrl-D, to terminate the
comment text entry.
wrjpgcom does not add a COM block if the provided comment string is empty. Therefore, you can use -replace -comment "" to delete all COM
blocks from a file.
EXAMPLES
Example 1: Adding a Short Comment to in.jpg to Produce out.jpg
example% wrjpgcom -c "View of my back yard" in.jpg > out.jpg
Example 2: Attaching a Long Comment Previously Stored in comment.txt
example% wrjpgcom in.jpg < comment.txt > out.jpg
or
example% wrjpgcom -cfile comment.txt < in.jpg > out.jpg
In this example, 1000 is a number that is larger than the number of rows in the source file.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWjpg |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO cjpeg(1), djpeg(1), jpegtran(1), rdjpgcom(1)NOTES
This man page was originally written by the Independent JPEG Group. Updated by Breda McColgan, Sun Microsystems Inc., 2004.
SunOS 5.10 26 Mar 2004 wrjpgcom(1)