Sponsored Content
Top Forums Shell Programming and Scripting remove characters from string based on occurrence of a string Post 302493793 by yinyuemi on Thursday 3rd of February 2011 05:23:45 PM
Old 02-03-2011
Code:
sed 's/\(.*_vw_\)\(.*\)/\2/' urfile

This User Gave Thanks to yinyuemi For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove special characters from string

Hi there, I'd like to write a script that removes any set of character from any string. The first argument would be the string, the second argument would be the characters to remove. For example: $ myscript "My name's Santiago. What's yours?" "atu" My nme's Snigo. Wh's yors? I wrote the... (11 Replies)
Discussion started by: chebarbudo
11 Replies

2. Shell Programming and Scripting

how to remove characters from a string

Hi. for the following line: Var1=${Array} now Array has text as "{hello there}" how do I remove the {} brackets before assigning the string to Var1? Thanks. (3 Replies)
Discussion started by: shadow_boi
3 Replies

3. Shell Programming and Scripting

remove last 4 characters from a string

I'm tring to remove the last 4 characters from strings in a file i.e. cat /tmp/test iwishicouldremovethis icouldremovethos so i would end up with the last 4 characters from each of the above i.e. this thos I thought of using cut -c ... but I'm not sure how many characters will... (7 Replies)
Discussion started by: josslate
7 Replies

4. Shell Programming and Scripting

Remove characters from string

Hi I am new in shell scripting and i want to manipulate a string. I have a string tha looks like: /home/nteath/file.txt I want to remove everything until the last "/" , to keep only the filename. e.g. /home/nteath/file.txt output: file.txt Thanks (2 Replies)
Discussion started by: nteath
2 Replies

5. Shell Programming and Scripting

Remove string between two special characters

Hi All, I have a variable like AVAIL="\ BACK:bkpstg:testdb3.iad.expertcity.com:backtest|\ #AUTH:authstg:testdb3.iad.expertcity.com:authiapd|\ TEST:authstg:testdb3.iad.expertcity.com:authiapd|\ " What I want to do here is that If a find # before any entry, remove the entire string... (5 Replies)
Discussion started by: engineermayur
5 Replies

6. UNIX for Dummies Questions & Answers

counting occurrence of characters in a string

Hello, I have a string like this 0:1:2:0:2:2:4:0:0:0:-200:500...... what i want is to break down how many different characters are there and their count. For example for above string it should display 0 - 5 times 1 - 1 times 2 - 3 times 4 - 1 times . . . I am stuck in writing... (8 Replies)
Discussion started by: exit86
8 Replies

7. 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

8. Shell Programming and Scripting

How to remove some special characters in a string?

Hi, I have string like this ="Lookup Procedure" But i want the output like this Lookup Procedure =," should be removed. Please suggest me the solution. Regards, Madhuri (2 Replies)
Discussion started by: srimadhuri
2 Replies

9. 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

10. UNIX for Dummies Questions & Answers

Count occurrence of string (based on type) in a column using awk

Hello, I have a table that looks like what is shown below: AA BB CC XY PQ RS AA BB CC XY RS I would like the total counts depending on the set they belong to: if search pattern is in {AA, BB, CC} --> count them as Type1 | wc -l (3 Replies)
Discussion started by: Gussifinknottle
3 Replies
MBRUNE(3)						   BSD Library Functions Manual 						 MBRUNE(3)

NAME
mbrune, mbrrune, mbmb -- multibyte rune support for C LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <rune.h> char * mbrune(const char *string, rune_t rune); char * mbrrune(const char *string, rune_t rune); char * mbmb(const char *string, char *pattern); DESCRIPTION
The 4.4BSD ``rune'' functions have been deprecated in favour of the ISO C99 extended multibyte and wide character facilities and should not be used in new applications. Consider working with wide characters instead, and using wcschr(3), wcsrchr(3), and wcsstr(3) instead of these functions. These routines provide the corresponding functionality of strchr(), strrchr() and strstr() for multibyte strings. The mbrune() function locates the first occurrence of rune() in the string pointed to by string. The terminating NUL character is considered part of the string. If rune is '', mbrune() locates the terminating ''. The mbrrune() function locates the last occurrence of rune in the string string. If rune is '', mbrune() locates the terminating ''. The mbmb() function locates the first occurrence of the null-terminated string pattern in the null-terminated string string. If pattern is the empty string, mbmb() returns string; if pattern occurs nowhere in string, mbmb() returns NULL; otherwise mbmb() returns a pointer to the first character of the first occurrence of pattern. RETURN VALUES
The function mbrune() returns a pointer to the located character, or NULL if the character does not appear in the string. The mbrrune() function returns a pointer to the character, or NULL if the character does not appear in the string. The mbmb() function returns a pointer to the pattern, or NULL if the pattern does not appear in the string. SEE ALSO
rune(3), setlocale(3), euc(4), utf2(4), utf8(5) HISTORY
The mbrune(), mbrrune(), and mbmb() functions first appeared in Plan 9 from Bell Labs as utfrune(), utfrrune(), and utfutf(). BSD
April 19, 1994 BSD
All times are GMT -4. The time now is 11:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy