Sponsored Content
Top Forums Shell Programming and Scripting How to replace special character using sed? Post 302715709 by codemaniac on Monday 15th of October 2012 09:31:07 AM
Old 10-15-2012
Quote:
Originally Posted by vivien_chu
How can I replace the follong text including to number 7000?

cat tmp0.txt

Winston (UK) Wong

I would the 7000 to replace Winston (UK) Wong.

I fail with method below:
sed ' s /Winston\(UK\)Wong/7000 tmp0.txt'
try
Code:
sed "s/Winston (UK) Wong/7000/" tmp0.txt

This User Gave Thanks to codemaniac For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed and special character in data

I have a script that is reading an existing report, pulling out the customer code, then tacking on the customer name from another file and replacing the existing customer code with the new field. This was written for me by someone else. I'm not real familiar with sed. The data is getting into... (3 Replies)
Discussion started by: MizzGail
3 Replies

2. Shell Programming and Scripting

Sed-Special character replacement

Hi I want to replace ./testsed.ksh with testsed.ksh ./ is to be removed scriptnm=`sed -e 's/\.///' $0 does not work Please help (3 Replies)
Discussion started by: usshell
3 Replies

3. Shell Programming and Scripting

Decode %s Special Character in Sed

Greetings, I am doing something that I don't know if it is possible... I have a file with a line looks like this: <%s \n%s / %s \n%s \n> and I am trying to replace this line with <%s \n%s \n%s / %s \n%s \n> in Shell script with sed command... StringToReplace='%s \n%s / %s \n%s \n'... (2 Replies)
Discussion started by: wasabihowdi
2 Replies

4. Shell Programming and Scripting

sed special character replace

I need to do the following: text in the format of: ADDRESS=abcd123:1111 - abcd123:1111 is different on every system. replace with: ADDRESS=localhost:2222 sed 's/ADDRESS=<What do I use here?>/ADDRESS=localhost:2222/g' Everything I've tried ends up with: ... (3 Replies)
Discussion started by: toor13
3 Replies

5. Shell Programming and Scripting

how to replace the special character with another using SED

I have the replace the pattern in the file , ); to ); Could someone please help me to get this command. (2 Replies)
Discussion started by: mohan.bit
2 Replies

6. Shell Programming and Scripting

How to replace with a special character in String

Hi, I am beginner to Shell Scripting. I have a String like this "testabcdef", i need the first character as it is and the remaining character should be replaced by the the '*' character. e.g(t***********) PLZ Suggest me. (5 Replies)
Discussion started by: nanthagopal
5 Replies

7. Shell Programming and Scripting

replace /n with special character

I would like to replace /n with ',' and after replace remove last semicolon then put a open brace in starting and closing brace in end of line. See below example: input: 1234 3455 24334 234 output: ('1234,'3455',24334','234') Thanks (3 Replies)
Discussion started by: anupdas
3 Replies

8. Shell Programming and Scripting

Replace Special Character With Next Present Byte

Hi, First find the special character, from the special character take next two bytes convert the bytes to decimal and replace with next present byte of decimal value times. E.g. Input: 302619ú1A? Output: 302619(3 spaces for ú1A)?????????????????????????? Thanks, Dines (27 Replies)
Discussion started by: dineshnak
27 Replies

9. Shell Programming and Scripting

Replace special characters with backslash and character

Hi, I have a string wherein i need to replace special characters with backslash and that character. Ex: If my string is a=qwerty123@!, then the new string should be a_new=qwerty123\@\!\, Thanks (3 Replies)
Discussion started by: temp_user
3 Replies

10. UNIX for Dummies Questions & Answers

Replacing special character with sed

Hi All, I have a text file that contains I1SP2 *=*=Y=M=D001D My requirement is to replace all occurrence of =* to =Z expected o/p is I1SP2 *=Z=Y=M=D001D I have tried with sed 's/=*/=Z/g' file sed 's!\=*!\=Z/g' file sed 's!\=*!\=Z!g' file sed 's!\=\*!\=Z!g' file but its not... (3 Replies)
Discussion started by: gotamp
3 Replies
mlib_MatrixTranspose_U8(3MLIB)				    mediaLib Library Functions				    mlib_MatrixTranspose_U8(3MLIB)

NAME
mlib_MatrixTranspose_U8, mlib_MatrixTranspose_U8C, mlib_MatrixTranspose_S8, mlib_MatrixTranspose_S8C, mlib_MatrixTranspose_S16, mlib_MatrixTranspose_S16C, mlib_MatrixTranspose_S32, mlib_MatrixTranspose_S32C - matrix transpose, in place SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_MatrixTranspose_U8(mlib_u8 *xz, mlib_s32 mn); mlib_status mlib_MatrixTranspose_U8C(mlib_u8 *xz, mlib_s32 mn); mlib_status mlib_MatrixTranspose_S8(mlib_s8 *xz, mlib_s32 mn); mlib_status mlib_MatrixTranspose_S8C(mlib_s8 *xz, mlib_s32 mn); mlib_status mlib_MatrixTranspose_S16(mlib_s16 *xz, mlib_s32 mn); mlib_status mlib_MatrixTranspose_S16C(mlib_s16 *xz, mlib_s32 mn); mlib_status mlib_MatrixTranspose_S32(mlib_s32 *xz, mlib_s32 mn); mlib_status mlib_MatrixTranspose_S32C(mlib_s32 *xz, mlib_s32 mn); DESCRIPTION
Each of these functions performs an in-place transpose of a square matrix. For real data, the following pseudo code applies: for (i = 1; i < mn; i++) { for (j = 0; j < i; i++) { tmp = xz[i*mn + j]; xz[i*mn + j] = xz[j*mn + i]; xz[j*mn + i] = tmp; } } For complex data, the following pseudo code applies: for (i = 1; i < mn; i++) { for (j = 0; j < i; i++) { tmp0 = xz[2*(i*mn + j)]; tmp1 = xz[2*(i*mn + j) + 1]; xz[2*(i*mn + j)] = xz[2*(j*mn + i)]; xz[2*(i*mn + j) + 1] = xz[2*(j*mn + i) + 1]; xz[2*(j*mn + i)] = tmp0; xz[2*(j*mn + i) + 1] = tmp1; } } PARAMETERS
Each of the functions takes the following arguments: xz Pointer to the source and destination matrix. mn Number of rows and columns in the matrix. RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_MatrixTranspose_U8(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_MatrixTranspose_U8(3MLIB)
All times are GMT -4. The time now is 08:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy