I have 500 text files in a folder. The data of the text files are shown below.
I would like to count the unique numbers of each country in the first and second columns based on the numbers of third column. I need to
save the outputs into another folder as the file names of input.
I use grep -c often, but cannot for the life of me count the number of occurences of a string on the same line (or within a file):
$ cat myfile
hello457903485897hello
34329048hellojsdfkljlaskdjgh182390
$ grep -c
2
$
How do I count the number of occurences of "hello" in myfile (i.e. 3)?... (6 Replies)
I have a file with contents similar to this.
abcd
1234
4567
7666
jdjdjd
89289
9382
92
jksdj
9823
298
I want to write a shell script which count the number of lines that start with the number (disregard the lines starting with alphabets) (1 Reply)
I have a sorted file like:
Apple 3
Apple 5
Apple 8
Banana 2
Banana 3
Grape 31
Orange 7
Orange 13
I'd like to search $1 and if $1 is not the same as $1 in the previous row print that row and print the number of times $1 was found.
so the output would look like:
Apple 8 3
Banana... (2 Replies)
Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count
The input file:
21 2341 A
21 2341 A
21 2341 A
21 2341 C
21 2341 C
21 2341 C
21 2341 C
21 4567 A
21 4567 A
21 4567 C
... (6 Replies)
Hi,
I have the following text in a file:
ISA*00* *00* *ZZ*ENS_EDI *ZZ*GATE0215 *110106*2244*U*00401*006224402*1*P*>~
GS*HP*ENS_EDI*GATE0215*20110106*2244*6224402*X*004010X091A1~
ST*835*00006~... (2 Replies)
Hi
Im a very inexperienced bioinformatician
I have a large DNA file with about 10000 lines of sequence and need to count the occurrence of TA for each line
for example in the file
TACGCGCGATA
TATATATA
GGCGCGTATA
I would like to get an output like:
2
4
2
I have tried... (3 Replies)
Hi,
I have a text file as shown below. I would like to count the unique number of connections of each person in the first and second column. Third column is the ID numbers of first column persons and fourth column is the ID numbers of second column persons.
susan ali 156 294... (7 Replies)
Hi,
Is there a command to do a sensitive/in-sensitive search for a string on a line and print how many times that string appears?
For example, if I have a line of text below:
dog cat rat apple banana dog lion tiger dog
Is there a command to search for dog that will print out 3 as a... (7 Replies)
I have some text files in a folder f1 with 10 columns. The first five columns of a file are shown below.
aab abb 263-455 263 455
aab abb 263-455 263 455
aab abb 263-455 263 455
bbb abb 26-455 26 455
bbb abb 26-455 26 455
bbb aka 264-266 264 266
bga bga 230-232 230 ... (10 Replies)