I wish to compute the number of dot chars in a string.
Example:
VAR="aaaa.bbbbb.cccc"
I try the shortest command to solve this test.
Thanks in advance for your help.
Regards,
Giovanni (7 Replies)
for example:
i hav a string like :
/rmsprd/arch01/rmsprd/rmsprdarch72736.log
how I can extract
my_num=72736?
I know I can
echo "/rmsprd/arch01/rmsprd/rmsprdarch72736.log" | tr "/" " " | awk '{ print $4 }' to get rmsprdarch72736.log (4 Replies)
To find out number of "|" symbol is available in file:
Input:
a|b|c|d|z
Ouput:
4
I am using below set of commands,It is working... Anybody have anyother solution using sed / awk.
cnt=`wc -c <1.txt`
cnt1=`tr -d "|" <1.txt >c.dat`
cnt2=`wc -c <c.dat`
outp=`expr $cnt... (19 Replies)
Hi!
I'm having trouble usind sed to remove the char ' from within a database's varchar register's sql.
For example, on the following sql:
INSERT INTO patrimonio_municipal.patrimonio_municipal_airc_tmp
Values('|Estação Elevatória|',|16723|,'|Grandes Reparações|',
'|2010-03-26... (3 Replies)
Hi everyone,
suppose that I have the following line:
#test your knowledge
can I use AWK to print the word "test" only? without the #?
what should I change to this:
awk '{print $1}'
thanks in advance guys (2 Replies)
Hi guys,
This is my input
2735:<7001> 34 789 701 2
2774:<7001> 34 789 701 2
How to delete characters after colon :
Including colon : too ?
My output should... (3 Replies)
I wanted to remove junk char in my csv. :mad:
Input file format:
"17","9986782190","0","D","2"
"17","9900918331","0","D","2"
"13","9986782194","0","A","2"
Output file format
9986782190
9900918331
9986782194
And one more thing all the time "13"," this will be different Ex: . (2 Replies)
hello
how can i cont number of char with loop coomand?
i dont want to use wc or other special command
the script should check all word's char. one by one
also a counter can handle the number
As noted in other threads started today. This is not the correct forum for homework assignments. ... (2 Replies)
I have a file with random characters where every time a char occurs twice, one occurrence must be removed.
Eg.
asjkdhaSSd
Must become:
asjkdhaSd
Anybody has a SED script in mind to do it? (1 Reply)
Hi I have a file where i want to remove a char before a specific pattern.
exp:
CREATE TABLE
(
A,
B,
C, ----comma needs to be removed
)AS SELECT
A,
B,
C, ----comma needs to be removed
FROM TABLE.
So i want to delete the comma(,) after the C both ways.Pattern can be... (11 Replies)
Discussion started by: raju2016
11 Replies
LEARN ABOUT OSF1
trbsd
trbsd(1) General Commands Manual trbsd(1)NAME
trbsd - Translates characters
SYNOPSIS
trbsd [-Acs] string1 string2
trbsd -d [-Ac] string1
The trbsd command copies characters from the standard input to the standard output with substitution or deletion of selected characters.
OPTIONS
Translates on a byte-by-byte basis. When you specify this option, trbsd does not support extended characters. Complements (inverts) the
set of characters in string1 with respect to the universe of characters whose codes are 001 through 377 octal if you specify -A, and all
characters if you do not specify -A. Deletes all characters in string1 from output. Changes characters that are repeated output charac-
ters in string2 into single characters.
DESCRIPTION
Input characters from string1 are replaced with the corresponding characters in string2. The trbsd command cannot handle an ASCII NUL
( 00) in string1 or string2; it always deletes NUL from the input.
The tr command is a System V compatible version of trbsd.
Abbreviations such as a-z, standing for a string of characters whose ASCII codes run from character a to character z, inclusive, can be
used to introduce ranges of characters. Note that brackets are not special characters.
Use the escape character (backslash) to remove the special meaning from any character in a string. Use the followed by 1, 2, or 3
octal digits for the code of a character.
If a given character appears more than once in string1, the character in string2 corresponding to its last appearance in string1 will be
used in the translation.
EXAMPLES
To translate braces into parentheses, enter: trbsd '{}' '()' <textfile >newfile
This translates each { (left brace) to a ( (left parenthesis) and each } (right brace) to a ) (right parenthesis). All other char-
acters remain unchanged. To translate lowercase ASCII characters to uppercase, enter: trbsd a-z A-Z <textfile >newfile The two
strings can be of different lengths: trbsd 0-9 # <textfile >newfile
This translates each digit to a # (number sign); if string2 is too short, it is padded to the length of string1 by duplicating its
last character. To translate each string of digits to a single # (number sign), enter: trbsd -s 0-9 # <textfile >newfile To trans-
late all ASCII characters that are not specified, enter: trbsd -c ' -~' 'A-_' <textfile >newfile
This translates each nonprinting ASCII character to the corresponding control key letter ( 01 translates to A, 02 to B, and so
on). ASCII DEL (177), the character that follows ~ (tilde), translates to a ? (question mark).
SEE ALSO
Commands: ed(1), sh(1), tr(1)
Files: ascii(5)trbsd(1)