Hi,
I would like to find a 3-letter character series in a string/variable and replace it with x's.
An example set of strings is:
The only constants are: 565MS333 and the time points at the end of each string (so 'screening', 'w24', 'w48', 'w96'). The rest can be variable.
I am trying to replace the 3-alpha characters in between the 3-digit numbers with x's (so, *_xxx_*). The 3 alpha characters are usually between underscores, but not always.
Thanks for the help/input!
Last edited by Scrutinizer; 01-23-2015 at 01:59 AM..
Reason: code tags
Hopefully someone can help out here. This is probably fairly basic, but I've searched and tried several variations of the solutions presented in these forums, so I'll go ahead and ask.
How can I locate a string in a file, delete the characters after the string and then replace the string with a... (2 Replies)
Hi All,
In the HP Unix that i'm using when i initialise a string as Stalled="'30¬G'"
Stalled=$Stalled" '30¬C'", it is taking the character ¬ as a comma. I need to grep for 30¬G 30¬C in a file and take its count. But since this character ¬ is not being understood, the count returns a zero.
The... (2 Replies)
Can I get some help on this please, I have looked at the many post with similar questions and have tried the solutions and they are not working for my scenario which is:
I have a text file (myfile) that contains
b_log=$g_log/FILENAME.log
echo "Begin processing file FILENAME " >> $b_log
... (4 Replies)
I have lines like:
Dog Cat House Mouse
Dog Cat House Mouse
Dog Cat House Mouse
Dog Cat House Mouse
I'd like to replace characters only in $3.
H -> Z
s -> W
e -> x
Resulting in something like (where $1, $2, and $4 are not changed):
Dog Cat ZouWx Mouse
Dog Cat ZouWx Mouse... (3 Replies)
Suppose that I have a string "one:#red two:#yellow three:#gr'een four:#blu^e" and I want to replace the pattern :# and the following characters in the word with nothing. The output string should look "one two three four" How can I do this with sed.
Some points to consider (a) the last word in... (1 Reply)
Hi all,
I want to count total no. of characters in a column. and if no. of charaters are more than 3 then it must replace it by splitted string. ie, it must place a space after 3 characters.
Ex:
21 435g asd3dd jklfjwe wer
column number 3 has 4 alphanumeric character, so it must be splitted... (3 Replies)
Hi I have a source file that looks like
a,b,c,d,e,f,g,h,t,DISTI(USD),MSRP(USD),DIST(EUR),MSRP(EUR),EMEA-DISTI(USD),EMEA-MSRP(USD),GLOBAl-DISTI(USD),GLOBAL-MSRP(USD),DISTI(GBP), MSRP(GBP)
I want to basically change MSRP(USD) to MSRP,USD and DIST(EUR) to DIST,EUR and likewise for all i'm using... (3 Replies)
Need command for position based replace:
I need a command to replace with 0 for characters in the positions 11 to 20 to all the lines starts with 6 in a file.
For example the file ABC.txt has:
abcdefghijklmnopqrstuvwxyz
6abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz... (4 Replies)
Hi,
I hope you can help me out please?
I need to replace from character 8-16 with AAAAAAAA and the rest should stay the same after character 16
gtwrhtrd11111111rjytwyejtyjejetjyetgeaEHT
wrehrhw22222222hytekutkyukrylryilruilrGEQTH
hrwjyety33333333gtrhwrjrgkreglqeriugn;RUGNEURGU
... (4 Replies)
Discussion started by: stinkefisch
4 Replies
LEARN ABOUT OSF1
wctype
wctype(3) Library Functions Manual wctype(3)NAME
wctype - Gets a handle to classify wide characters
LIBRARY
Standard C Library (libc)
SYNOPSIS
#include <wctype.h>
wctype_t wctype( const char *property);
The following prototype for wctype() does not conform to current industry standards and is supported only for backward compatibility:
#include <wchar.h>
wctype_t wctype(
char *property);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
wctype(): XSH5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to a string that identifies a character class, or property.
DESCRIPTION
The wctype() function obtains a handle for valid property names for wide characters, as defined in the current locale. The handle can then
be used as the wc_prop parameter in a subsequent call to the iswctype() function to check whether a wide character has this property. (See
the iswctype(3) reference page.) Values returned by the wctype() function are valid until the setlocale() function modifies the value of
the LC_CTYPE environment variable. The property parameter can have a value equal to one of the basic character classes or to any other
character class that is defined for a locale. The characters included in each class are specified in the locale definition file (see the
localedef(1) and locale(4) reference pages for more information). The basic character classes are as follows: A combination of the classes
alpha and digit. Alphabetic (letter) characters. This class automatically includes characters in the upper and lower classes. Blank char-
acters, such as the space or tab character. Control characters. This class does not include characters in the alpha or print class.
Numeric digit characters. This class includes the following characters:
0 1 2 3 4 5 6 7 8 9 Graphic characters for printing. This class does not include characters in the space or cntrl class but includes
all characters in the alpha, digit, and punct classes. Lowercase characters. This class does not include characters in the cntrl,
digit, punct, or space class. At a minimum, the lower class includes the 26 lowercase US-ASCII characters. These are:
a b c d e f g h i j k l m n o p q r s t u v w x y z Print characters. This class includes characters in the graph and space classes
but does not include characters in the cntrl class. Punctuation characters. This class does not include characters in the space,
alpha, digit, or cntrl class. Space characters. At a minimum, this class includes the space, form-feed, newline, carriage-return,
tab, and vertical-tab characters. Uppercase characters. At a minimum, this class includes the 26 uppercase US ASCII characters.
These are:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Hexadecimal characters. This class includes the following characters:
0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
For the list of supplemental properties that can be defined in Unicode locales, see the locale(4) reference page. On Tru64 UNIX systems,
Unicode character properties are defined only in locales whose names end in .UTF-8.
RETURN VALUES
On successful completion, the wctype() function returns a value of type wctype_t, which is a handle for valid property names in the current
locale. If the property parameter specifies a character class that is not valid for the current locale, the function returns the value 0
cast to wctype_t.
RELATED INFORMATION
Commands: localedef(1)
Files: locale(4)
Functions: ctype(3), iswctype(3), setlocale(3), towupper(3), wctrans(3) delim off
wctype(3)