deletion of duplicate characters and count

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers deletion of duplicate characters and count
# 1  
Old 08-19-2011
Bug deletion of duplicate characters and count

to delete the duplicate characters in a file I used this code
cat file.txt|tr -s "[a-z]"

tell the other ways using sed

command to count of duplicate characters


Last edited by vbe; 08-19-2011 at 11:30 AM.. Reason: Use code tags please!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count consecutive characters

Need to count consecutive characters in a string and give the output as below i/p=aaaabbcaa o/p=a4b2c1a2 (10 Replies)
Discussion started by: prasanna2166
10 Replies

2. Shell Programming and Scripting

[Solved] Count characters of variable from right

My variable is something like: f="/Volumes/VERVE/MOOTON_CALL/01_shots/XX/xx0195/Projects/program/rs0195_v400001.aep" I use ${f:63:6} to call "rs0195" as characters counted from the left, but it'd be so much easier to count from the right. If ${f:95:10} counts from the left, what would... (2 Replies)
Discussion started by: scribling
2 Replies

3. Shell Programming and Scripting

Count duplicate lines ignoring certain columns

I have this structure: col1 col2 col3 col4 col5 27 xxx 38 aaa ttt 2 xxx 38 aaa yyy 1 xxx 38 aaa yyy I need to collapse duplicate lines ignoring column 1 and add values of duplicate lines (col1) so it will look like this: col1 col2 col3 col4 col5 27 xxx 38 aaa ttt ... (3 Replies)
Discussion started by: coppuca
3 Replies

4. Shell Programming and Scripting

Count characters after a line

Hi All! I would like to solve a problem but I have no clue of how do it!I will be grateful if someone could help me! I have a file like this: > genes | transcript ...sequence.... >ENSMUSG00000006638|ENSMUST00000006814 GGGAAATGGAATACCCCTACACAACCAAGATGCTGAGTTCCTCCCTGAGCCCGCAAAACG... (2 Replies)
Discussion started by: giuliangiuseppe
2 Replies

5. Shell Programming and Scripting

Extract and count number of Duplicate rows

Hi All, I need to extract duplicate rows from a file and write these bad records into another file. And need to have a count of these bad records. i have a command awk ' {s++} END { for(i in s) { if(s>1) { print i } } }' ${TMP_DUPE_RECS}>>${TMP_BAD_DATA_DUPE_RECS}... (5 Replies)
Discussion started by: Arun Mishra
5 Replies

6. UNIX for Dummies Questions & Answers

count different characters from one column

Hi everyone, and thanks after all I'm a biologist and i have to extract information from one text. The text is something like this 1023 A A 56 0 cc...,,,,,,c..CC..,, 1024 T T 86 0 ..,,,..aaAA..,,aAA,,a,,A,,a 1025 G G 125 0 ... (5 Replies)
Discussion started by: beajorrin
5 Replies

7. Shell Programming and Scripting

Count number of characters in particular column

Hi i have data like abchd 124 ldskc aattggcc each separated by tab space i want to count number of characters in 4th column and print it in new column with tabspace for every line can anyone help me how to do it. Thanks. (3 Replies)
Discussion started by: bhargavpbk88
3 Replies

8. UNIX for Dummies Questions & Answers

Count the characters in a string

Hi all, I like to know how to get the count of each character in a given word. Using the commands i can easily get the output. How do it without using the commands ( in shell programming or any programming) if you give outline of the program ( pseudo code ) i used the following commands ... (3 Replies)
Discussion started by: itkamaraj
3 Replies

9. Shell Programming and Scripting

Deletion of characters in every second line

Hi, I have a file with four types of lines: @HWUSI-EAS656_0022:8:1:175:376#0/1 CTCGACACGCTGGTGGAGATCCTCGGCCTGACCGAGGACGACCGGGCCATCTTCGAGCAGCGC + BBBBBBBA?AABB;<=B9<===AA1AA==>99===.9?:9A4A956%%%%%%%%%%%%%%%%% I want to remove the first 6 characters of every second line. This means in... (10 Replies)
Discussion started by: s052866
10 Replies

10. Shell Programming and Scripting

Duplicate count in a file

I have a file like this : NAME User ------ ----- ABC 90xyz ABC 90tuv CDE 90xyz CDE 90pqr ERT 90xyz ERT 90pqr : : : : I need to get the ducplicate count of Users. Like, ... (3 Replies)
Discussion started by: deo_kaustubh
3 Replies
Login or Register to Ask a Question
wstring(3C)						   Standard C Library Functions 					       wstring(3C)

wstring, wscasecmp, wsncasecmp, wsdup, wscol - Process Code string operations SYNOPSIS
#include <widec.h> int wscasecmp(const wchar_t *s1, const wchar_t *s2); int wsncasecmp(const wchar_t *s1, const wchar_t *s2, int n); wchar_t *wsdup(const wchar_t *s); int wscol(const wchar_t *s); DESCRIPTION
These functions operate on Process Code strings terminated by wchar_t null characters. During appending or copying, these routines do not check for an overflow condition of the receiving string. In the following, s, s1, and s2 point to Process Code strings terminated by a wchar_t null. wscasecmp(), wsncasecmp() The wscasecmp() function compares its arguments, ignoring case, and returns an integer greater than, equal to, or less than 0, depending upon whether s1 is lexicographically greater than, equal to, or less than s2. It makes the same comparison but compares at most n Process Code characters. The four Extended Unix Code (EUC) codesets are ordered from lowest to highest as 0, 2, 3, 1 when characters from different codesets are compared. wsdup() The wsdup() function returns a pointer to a new Process Code string, which is a duplicate of the string pointed to by s. The space for the new string is obtained using malloc(3C). If the new string cannot be created, a null pointer is returned. wscol() The wscol() function returns the screen display width (in columns) of the Process Code string s. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
malloc(3C), string(3C), wcstring(3C), attributes(5) SunOS 5.10 29 Dec 1996 wstring(3C)