Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to replace particular occurrence of character in between a delimiter? Post 302834709 by H_bansal on Friday 19th of July 2013 03:13:34 PM
Old 07-19-2013
How to replace particular occurrence of character in between a delimiter?

Hi,
Hi,

I have a file with following format

Code:
1|" "text " around " |" fire "guest"|" "
2| "xyz"" | "no guest"|"3"
3| """ test3""| "one" guest"|"4"

My requirement is to replace all occurrences of " to ' which are occurring between |" "|delimiter
so my output should look like this

Code:
1|" 'text ' around " |" fire ' guest"|" "
2|"xyz' "|"no guest"|"3"
3|" ' ' test3' "| "one ' guest"|"4"

Any help regarding this will be higly appreciated.

Thanks,
Himani

Last edited by Scrutinizer; 07-19-2013 at 04:34 PM.. Reason: Removed rogue formatting; code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Search and replace to first occurrence of string

Hi all, I have a very large; delimited file. In vi I would like to replace: CSACT_DY;AVG_UEACT1;uesPerActiveLinkSetSize_1;#;A CSACT_DY;AVG_UEACT2;uesPerActiveLinkSetSize_2;#;A CSACT_DY;AVG_UEACT3;uesPerActiveLinkSetSize_3;#;A with: CSACT_DY;AVG_UEACT1;Average... (7 Replies)
Discussion started by: gilmord
7 Replies

2. Shell Programming and Scripting

Replace second occurrence only

HPUX /bin/sh (posix) I have a file as such cat dog mouse deer elk rabbit mouse rat pig I would like to replace the second occurrence of mouse in this file with mouse2. The rest of the file has to stay exactly as is. I'm not sure exactly where mouse might be (could be first,second,third... (5 Replies)
Discussion started by: lyoncc
5 Replies

3. Shell Programming and Scripting

SED replace string by occurrence

hi all, I have a text file with following content PAGENUMBER asasasa asasasa PAGENUMBER sasasasasa PAGENUMBER using sed i want to replace PAGENUMBER by occurrence count eg 1 asasasa asasasa 2 sasasasasa 3 (4 Replies)
Discussion started by: uttamhoode
4 Replies

4. Shell Programming and Scripting

Sed to print a string until the second occurrence of a character

Hi, I am totally new to shell scripting. I have a String "c:\working\html\index.txt.12-12-2009.bkp" I want to check if the string has more than one "." character. If it does I would like to retrieve only "c:\working\html\index.txt" i.e, discard the second occurrence of "." and the rest of the... (7 Replies)
Discussion started by: imr
7 Replies

5. Shell Programming and Scripting

Remove last occurrence of character (_) and rest of the string in UNIX (sed)

Hi I need help on this ..!! Input : xx_abc_regA xx_def_regB xx_qwe_regC Now i required the output as the below abc def qwe Need to remove last occurrence of character (_) and rest of the string in Unix (sed). Thanks in Advance ..!!! -Nallachand (3 Replies)
Discussion started by: Nallachand
3 Replies

6. Shell Programming and Scripting

Find last occurrence of a character in a string

Hello how to find last occurence of a string for example in the following I want last occurence of '-' i.e. position 12 str="aa-bbb-cccc-ddd-ee" my pupose is to get the string 'ee' Thanks and Regards Chetanz (5 Replies)
Discussion started by: Chetanz
5 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Replace first occurrence after match

hey guys, i have been trying to work this thing out with sed with no luck :confused: i m looking for a way to replace only the first occurrence after a match for example : Cat Realized what you gotta do Dog Realized what you gotta do Sheep Realized what you gotta do Wolf Realized... (6 Replies)
Discussion started by: boaz733
6 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Awk: count occurrence of each character for every field

Hi, let's say an input looks like: A|C|C|D A|C|I|E A|B|I|C A|T|I|B as the title of the thread explains, I am trying to get something like: 1|A=4 2|C=2|B=1|T=1 3|I=3|C=1 4|D=1|E=1|C=1|B=1 i.e. a count of every character in each field (first column of output) independently, sorted... (4 Replies)
Discussion started by: beca123456
4 Replies

9. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies

10. Shell Programming and Scripting

awk or other way to find out number of occurrence of 7th character

Hi all, I am looking for to filter out based on 7th character and list the number of occurrence based on the 7th character if p , d , o or m 1. if 7th character is p , Output should be: p_hosts = N 2. if 7th character is d , Output should be: d_hosts = N 3. if 7th character is o , Output... (10 Replies)
Discussion started by: rveri
10 Replies
XBDBACK(4)						 BSD/xen Kernel Interfaces Manual						XBDBACK(4)

NAME
xbdback -- Xen backend paravirtualized block device interface SYNOPSIS
pseudo-device xbdback DESCRIPTION
The xbdback interface forms the backend part of the paravirtualized drivers used by Xen domains to offer a block device interface, similar to a hard disk. xbdback interfaces are backed either by a physical device directly, or an image file mounted through vnd(4). All xbdback interfaces follow the ``xbdbackXiY'' naming convention, where 'X' represents the guest domain identifier, and 'Y' an arbitrary identifier. This identifier is usually associated to the device node as seen by the guest using major(3) and minor(3) numbers. For example, identifier ``769'' (0x301) means major 3 and minor 1, identified as ``hda1'' under Linux convention. For NetBSD, the guest device name spec- ified in the guest configuration file does not matter, and can be chosen arbitrarily. A xbdback interface will appear as a xbd(4) block device inside a NetBSD guest domain. In the XenStore, xbd and xbdback are identified by ``vbd'' (virtual block device) entries. DIAGNOSTICS
xbd backend: attach device %s (size %d) for domain %d Gives the device used as xbdback interface for the given guest domain, and its size, in bytes. xbd backend 0x%x for domain %d using event channel %d, protocol %s Gives the backend identifier, guest domain ID, event channel ID, and pro- tocol used for block level communication. xbdback %s: can't VOP_OPEN device 0x%x: %d When this message appears in the system message buffer with error 16 (EBUSY), the device is likely to be already mounted. It must be unmounted first, as the system will refuse to open it a second time. SEE ALSO
vnd(4), xbd(4), xenbus(4) HISTORY
The xbdback driver first appeared in NetBSD 4.0. AUTHORS
The xbdback driver was written by Manuel Bouyer <bouyer@NetBSD.org>. BSD
June 7, 2011 BSD
All times are GMT -4. The time now is 01:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy