Sponsored Content
Top Forums Shell Programming and Scripting Urgent help needed !!!....to replace a exact string Post 302466122 by rahulfhp on Monday 25th of October 2010 02:07:56 PM
Old 10-25-2010
MySQL Urgent help needed !!!....to replace a exact string

Hi experts,

As i am a novice unix player...so need help for the below query...banged my head from quite a while...Smilie

i have a set of html files, in which i need to search for string "Page"(case sensitive) and then replace the same with some numeric code ,say, "XXX1234".
Here in html files, there are some other similar strings like totalPage,currentPage,etc ....


i have tried using grap and using sed command, but problem here using grap is that it will return single line containing "Page" and then i can use sed to replace that word, but along with that i need non-replaced content as it is, and final output should be html file with only desired pattern replaced.

Was thinking , if any solution is there other than formal looping constructs.

would be a great help.....Smilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed :Search and Replace a string pattern with empty in an xml file in unix

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)
Discussion started by: harish_s_ampeo
1 Replies

2. Shell Programming and Scripting

search and replace exact string

Hello Everyone, Im trying to run a search and replace of exact strings and the strings that im using variables that are passed through an array in a while loop. Here is a snip of my code: USEROLD=`cat oldusers` USERNEW=`cat newusers` USEROLDARRAY=( $USEROLD ) USERNEWARRAY=( $USERNEW )... (4 Replies)
Discussion started by: skizim
4 Replies

3. Shell Programming and Scripting

How to use SED or AWK to search and replace an exact string

I have a file DS1 DDS DS I want to replace only "DS" to "DSmail.blah.com" in a lot of files. I tried sed 's/DS/DSmail.blah.com' but it changes all the lines . thanks in advance (2 Replies)
Discussion started by: gubbu
2 Replies

4. Shell Programming and Scripting

replace a string in perl - Urgent

Hi, Can anyone help me to replace ='is NOT NULL' to is NOT NULL in perl. I tried all the methods which i know, i didnt arrive at the solution. please help!! ---------- Post updated at 03:01 PM ---------- Previous update was at 02:56 PM ---------- I got it.......! Thanks, (1 Reply)
Discussion started by: jam_prasanna
1 Replies

5. Shell Programming and Scripting

Exact Text Replace

I am currently working with a bash script to change some names around in 3 files. I am attempting to do this with sed but I haven't been able to get it so it won't replace partial matches. Below is an example of the files I am trying to edit. My main goal is to replace foo with test, but I... (4 Replies)
Discussion started by: Takau
4 Replies

6. Shell Programming and Scripting

QUESTION1: grep only exact string. QUESTION2: find and replace only exact value with sed

QUESTION1: How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed. Contents of car.txt CAR1_KEY0 CAR1_KEY1 CAR2_KEY0 CAR2_KEY1 CAR1_KEY10 CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1 grep... (1 Reply)
Discussion started by: thibodc
1 Replies

7. Shell Programming and Scripting

grep exact string from files and write to filename when string present in file

I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies

8. Shell Programming and Scripting

Grep exact string from main string

Hi , am getting output file, it sontains the below values. ./hawk_DOM1_FIRST_ENV ./hawk_DOM2_SECOND_ENV ./hawk_DOM3_THIRD_ENV Now I need to grep the word "DOM1_FIRST_ENV","DOM2_SECOND_ENV" like that. I tired with cut -d "_". Its not working with any deleimiter. Can you please help to... (3 Replies)
Discussion started by: ckchelladurai
3 Replies

9. Shell Programming and Scripting

Issue with sed command does not replace exact string matched

I have a file change.sed more change.sed I fire the below command inorder to replace "190.169.11.15" with "10.4.112.240" in proxy.logsed -f change.sed proxy.log proxy.log has the below entry more proxy.log The command replaces both 190.169.11.15 & 190.169.11.155 as below: I am expecting... (17 Replies)
Discussion started by: mohtashims
17 Replies
GRAP2GRAPH(1)						      General Commands Manual						     GRAP2GRAPH(1)

NAME
grap2graph - convert a grap diagram into a cropped bitmap image SYNOPSIS
grap2graph [ -unsafe ] [ -resolution M|MxN ] [ -format fmt ] DESCRIPTION
Reads a grap program as input; produces an image file (by default in Portable Network Graphics format) suitable for the Web as output. For a description of the grap language, see grap(1). Your graph specification should not be wrapped with the .G1 and .G2 macros that normally guard it within groff(1) macros. The output image will be a black-on-white graphic clipped to the smallest possible bounding box that contains all the black pixels. By specifying command-line options to be passed to convert(1) you can give it a border, set the background transparent, set the image's pixel density, or perform other useful transformations. This program uses grap(1), pic(1), groff(1), and the ImageMagick convert(1) program. These programs must be installed on your system and accessible on your $PATH for grap2graph to work. OPTIONS
-unsafe Run pic(1) and groff(1) in the `unsafe' mode enabling the PIC macro sh to execute arbitrary commands. The default is to forbid this. -format fmt Specify an output format; the default is PNG (Portable Network Graphics). Any format that convert(1) can emit is supported. Command-line switches and arguments not listed above are passed to convert(1). ENVIRONMENT
GROFF_TMPDIR The directory in which temporary files will be created. If this is not set grap2graph searches the environment variables TMPDIR, TMP, and TEMP (in that order). Otherwise, temporary files will be created in /tmp. SEE ALSO
pic2graph(1), eqn2graph(1), pic(1), groff(1), gs(1), convert(1). AUTHOR
Eric S. Raymond <esr@thyrsus.com> Groff Version 1.22.2 7 February 2013 GRAP2GRAPH(1)
All times are GMT -4. The time now is 09:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy