I want to find the number of occurences of a character in a file.
How do i do it.
Eg:
$cat file1.txt
Welcome to World of Unix.
$
If i want to find the occurences of 'o' then I should be getting 3.
Thanks. (6 Replies)
Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/
Thanks! (1 Reply)
I already have accomplished this task using sed and arrays, but since I get the variable using awk, I figured I'd ask this question and maybe I can get a cleaner solution using strictly awk.. I just can't quite grasp it in awk.
Story: I'm automating the (re)configuration of network interfaces,... (3 Replies)
Hi All,
Was wondering how I can do the following....
I have a String as follows
"ACCTRL000005022RRWDKKEEDKDD...."
This string can be in a file called tail.out or in a Variable called $VAR2
Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Hi,
I am trying to convert multiple Unix pipe symbol or bar into single |. I have tried with the following sed statements, but, no success :(. I need it using sed only
echo "sed 's/\|\+/\|/g'
sed 's/*/\|/'
sed 's/\|*/|/'
sed -r 's/\|+/\|/'
However, the below awk code is working fine.... (4 Replies)
Hi all,
I am very new to unix - ksh. I want to replace some characters in a file with some other, but only for first three occurances for each line.
For eg:
the first 3 occurances character ']' has to be replaced with ',' in each line.
Please help.
thanks
Sreejith (1 Reply)
This is for AIX 6.1, I've a flat file and the format is like this
DECLARE
some statements;
BEGIN
some statements;
END;
I've to search BEGIN and replace it with the following 4 lines
BEGIN
For x in 1..1
LOOP
BEGIN
Similarly I've to search END and replace it with the... (7 Replies)
hello
i have file with 100k records and each one has certain value that starts at 28th column and certain value that starts at 88th column
e.g. 1st file
<25>1234567 ..... <88> 8573785485
i have aditional file with values which are related to value that starts at 88th column of the... (1 Reply)
I have a csv dataset like this :
C,rs18768
G,rs13785
GA,rs1065
G,rs1801279
T,rs9274407
A,rs730012
I'm thinking of use like awk, sed to covert the dataset to this format: (if it's two character, then keep the same)
CC,rs18768
GG,rs13785
GA,rs1065
GG,rs1801279
TT,rs9274407... (7 Replies)
Discussion started by: nengcheng
7 Replies
LEARN ABOUT OSF1
iso2022
iso2022(5) File Formats Manual iso2022(5)NAME
iso2022, iso-2022, ISO-2022 - A character encoding mechanism standardized by the International Standards Organization (ISO)
DESCRIPTION
The ISO-2022 standard defines a mechanism for handling single-byte and multibyte characters. The standard specifies four classes of charac-
ter sets: The 94-charset class, which contains character sets with 94 positions (single-byte characters). Examples are the ASCII and JIS
X0201 character sets. The 96-charset class, which contains character sets with 96 positions (single-byte characters). Examples are the ISO
Latin series of character sets. The 94x94-charset class, which contains character sets with 94x94 positions (2-byte characters). Examples
are the GB 2312 and the CNS 11643 character sets. The 96x96-charset class, which contains character sets with 96x96 positions (2-byte
characters).
In the ISO-2022 standard, four registers, called G0, G1, G2 and G3, are used to reference a character set. Before a character set can be
used, the character set must be assigned, or designated, to one of these registers. The designation of a character set is done by using an
escape sequence in the following format:
ESC [I] F
In this format: Is an intermediate character that is used to designate a character set to one of the registers (G0, G1, G2, oR G3). Is a
unique final character of a particular character set.
The designation of a character set, whose final character is F, to different registers is as follows: Designates a multibyte character set
(94x94 or 96x96) to G0. Designates a character set in the 94-charset class to G0. Designates a character set in the 94-charset class to
G1. Designates a character set in the 94-charset class to G2. Designates a character set in the 94-charset class to G3. Designates a
character set in the 96-charset class to G1. Designates a character set in the 96-charset class to G2. Designates a character set in the
96-charset class to G3.
SEE ALSO
Commands: locale(1)
Others: ascii(5), i18n_intro(5), iso2022jp(5), l10n_intro(5)iso2022(5)