Sponsored Content
Top Forums Shell Programming and Scripting sed - replace string question Post 302155546 by danmero on Friday 4th of January 2008 12:55:08 PM
Old 01-04-2008
Thats corect cassj. See the edited post.

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED Replace String Help

I have to replace date in Control file every day i run the script control file looks like this $cat pharma.ctl LOAD DATA INFILE '/usr/bin/sqlscripts/SQL.PharmID.20071206.txt' INTO TABLE uname.TEMP_TABLE FIELDS TERMINATED BY '|' TRAILING NULLCOLS (col_names) i tried $sed -e... (2 Replies)
Discussion started by: prash184u
2 Replies

2. Shell Programming and Scripting

sed: replace string with another string (with spaces)

Hi I have an XML file with strings XABCD, XEFGHX and XIJKLX. I would like to replace XABCDX with "This is the first string", XEFGHX with "This is the second string" and XIJKLX with "This is the third string". What is the best way to implement this? Should I have a file with the data that is... (4 Replies)
Discussion started by: zmfcat1
4 Replies

3. UNIX for Dummies Questions & Answers

sed/grep string replace question

Hi all, I know this question has probably been answered before, but I am struggling with this problem, even after googling a million pages. In a file named rdmt.conf I need a single character replaced, the number in the line below CUR_OC4J_ID=1 It will always appear after... (3 Replies)
Discussion started by: Mike AAA
3 Replies

4. Shell Programming and Scripting

Using sed to replace a string in file with a string in a variable that contains spaces

Hi, i call my shell like: my_shell "my project name" my script: #!/bin/bash -vx projectname=$1 sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp cp temp test_config_doxy the following error occurres: sed s/'PROJECT_NAME ... (2 Replies)
Discussion started by: vivelafete
2 Replies

5. Shell Programming and Scripting

How to use sed to replace the a string in the same file using sed?

How do i replace a string using sed into the same file without creating a intermediate file? (7 Replies)
Discussion started by: gomes1333
7 Replies

6. Programming

Question how to replace last character string

Hi, Could someone help me how to replace last character string. For example $>export T1=abcde $>export T2=xyz my question is how to get result abcdxyz? Many Thanks (2 Replies)
Discussion started by: nicklau81
2 Replies

7. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

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)
Discussion started by: jforce
2 Replies

8. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

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)
Discussion started by: vivek d r
10 Replies

9. Shell Programming and Scripting

Replace string in XML file with awk/sed with string from another

Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file: </member> <member> <name>TransactionID</name> <value><string>123456789123456</string></value> </member> <member> <name>Number</name> ... (9 Replies)
Discussion started by: cozzin
9 Replies

10. Shell Programming and Scripting

Using sed to replace string

Hello guys, I'm working in a cellular company and i'm trying to do a script to run some commands automaticlly. I'm using Solaris version :SunOS pk-ercuas4 5.10 in my work. I've a file that creates by script named test1.mos that that look like: confb+ gsg+ lt all $date = `date... (1 Reply)
Discussion started by: oferg
1 Replies
REDIFF(1)							     Man pages								 REDIFF(1)

NAME
rediff, editdiff - fix offsets and counts of a hand-edited diff SYNOPSIS
rediff ORIGINAL EDITED rediff EDITED rediff {[--help] | [--version]} editdiff FILE editdiff {[--help] | [--version]} DESCRIPTION
You can use rediff to correct a hand-edited unified diff. Take a copy of the diff you want to edit, and edit it without changing any offsets or counts (the lines that begin "@@"). Then run rediff, telling it the name of the original diff file and the name of the one you have edited, and it will output the edited diff file but with corrected offsets and counts. A small script, editdiff, is provided for editing a diff file in-place. The types of changes that are currently handled are: o Modifying the text of any file content line (of course). o Adding new line insertions or deletions. o Adding, changing or removing context lines. Lines at the context horizon are dealt with by adjusting the offset and/or count. o Adding a single hunk (@@-prefixed section). o Removing multiple hunk (@@-prefixed sections). Alternatively, if only one argument is provided, it is taken to be the edited file and the counts and offsets are adjusted as appropriate. Some assumptions are made when used in this mode. See recountdiff(1) for more information. OPTIONS
--help Display a short usage message. --version Display the version number of rediff. SEE ALSO
interdiff(1), recountdiff(1) AUTHOR
Tim Waugh <twaugh@redhat.com> Package maintainer patchutils 13 May 2002 REDIFF(1)
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy