Script to replace a string with pattern read from a file
I have two files blocks.txt and rules.txt. In blocks.txt i have the following entries
In rules.txt i have the lines where a filename pattern starts like
I want to replace 'blk-name' with the names read from blocks.txt file
I tried with following code.But it replaces with "$blocks".Could anyone pl. help me correct this
I am facing one problem, can any one please suggest me the command for the same in unix. I am using Ksh.
I have a large file with the data that looks like below.
"ROTO2-2007f","_US01","9/15/2007","9/21/2007",346492,"NICK, LCD WATCH"97,1,"NAPOLITJ ","BERGER,M Z & CO INC",0.01,
... (2 Replies)
Search and Replace a string pattern with empty in an xml file in unix:
My xml file would be like this :
<Accounts><Name>Harish</Name><mobile>90844444444444445999 </mobile><TRIG>srcujim-1</TRIG></Accounts><Accounts><Name>Satish</Name><mobile>908999</mobile><TRIG>ettertrtt-1</TRIG></Accounts>
... (1 Reply)
Hello,
I have a file ( say file1) which has lines like below.
xxxx:xxxx,yyyy,1234,efgh
zzzz:zzzz,kkkk,pppp,1234,xxxx,uuuu,oooo
dddd:dddd
here the word before ":" ( ie: xxxx) is the file name and the string after : are also file names, but each file name separated by ","
In case of... (20 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Dear all,
I have a number of files and each file has two sections separated by a blank line. At the top section, I have lines which describes the values of the alphabetical characters,
# s #; 0.123
# p #; 12.3
# d #; -2.33
# f #; 5.68
<blank line>
sssssss
spfdffff
sdfffffff
Now I... (4 Replies)
Hi Friends,
I have a text file like this
cat main.txt
I like this website
cat website > new_website
grep website > hello_website
cat replace.txt
hello
unix
apple
Now, for each line read in 2.txt, I want the pattern "website" in 1.txt to be replaced with it. Basically, I... (9 Replies)
Hi all, the value in the following file is just an example. It could be a different value/network addresses.
Here is my example of initial output in a file name net.txt
Initial Output, net.txt
The goal is to produce the following format which is to convert from CIDR to Netmask... (6 Replies)
Hello Forum.
I have a file called abc.sed with the following commands;
s/1/one/g
s/2/two/g
...
I also have a second file called abc.dat and would like to substitute all occurrences of "1 with one", "2 with two", etc and create a new file called abc_new.dat
sed -f abc.sed abc.dat >... (10 Replies)
Hi ,
I have a property file placed in folder /usr/opt/temp/aorc.prop which has values given below . I need to read this file content and replace the node with actual values in a shell script . Each time the script shall replace the node value from the poperty file and execute a cfsend command and... (10 Replies)
Discussion started by: samrat dutta
10 Replies
LEARN ABOUT OSX
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)