Hi ,
I have a similar problem.
Please can anyone help me with a shell script or a perl.
I have a flat file like this
I want to get a output like
Is there anyways this can be done?
Hi, buddies out there.
I have a text file ( only one column ) which I created using vi editor. The file contains duplicate rows and I would like to select distinct rows, how to go on it using unix command:
file content =
apple
apple
orange
watermelon
apple
orange
Can it be done... (7 Replies)
Datafile has the following data seperated by :
FIELD1:FIELD2:FIELD3
D1:/opt/9.1.9:Y
D2:/opt/10.1.10:Y
D3:/opt/9.1.9:Y
D4:/opt/8.1.8:Y
D5:/opt/8.1.8:Y
D6:/opt/9.1.9:Y
D7:/opt/9.1.9:Y
D8:/opt/10.1.10:Y
D9:/opt/9.1.9:Y
D10:/opt/10.1.10:Y
I want to do some operations only on the distinct... (2 Replies)
Hi
I have a pipe delimited file. I am trying to grab the DISTINCT value from the second field. The file is something like:
1233|apple|ron
1234|apple|elephant
1235|egg|man
the output I am trying to get from second field is apple,egg (apple coming only once)
Thanks
simi (4 Replies)
How do I create a script that provides a count of distinct values of a particular field in a file utilizing commonly available UNIX commands (sh or awk)?
Field1|Field2|Field3|Field4
AAA|BBB|CCC|DDD
111|222|333|777
AAA|EEE|ZZZ|EEE
111|555|333|444
AAA|EEE|CCC|DDD
111|222|555|444
For... (2 Replies)
this is a little more complex than that. I have a text file and I need to find all the distinct words that appear in a line after the word TABLESPACE
when I grep for just the word tablespace, I get:
how do i parse this a little better so i have a smaller file to read?
This is just an... (4 Replies)
I am a beginner to scripting, please help me in this regard.
How do I create a script that provides a count of distinct values of all the fields in the pipe delimited file ? I have 20 different files with multiple columns in each file. I needed to write a generic script where I give the number... (1 Reply)
I am a beginner to scripting, please help me in this regard.
How do I create a script that provides a count of distinct values of all the fields in the pipe delimited file ? I have 20 different files with multiple columns in each file. I needed to write a generic script where I give the number... (2 Replies)
Hi, I have the following file:
LOG:015608::ERR:2310:map_spsrec:Invalid parameter
LOG:015608::ERR:2471:map_dgdrec:Invalid parameter
LOG:015608::ERR:2487:map_nnmrec:Invalid number
LOG:015608::ERR:2310:map_nmrec:Invalid number
LOG:015608::ERR:2438:map_nmrec:Invalid number
As a delimiter I... (2 Replies)
Hi....I need one help....
I'm having a files which is having the data as follows...
a
b
c c
d d d
e
f
Now I need to find out distinct characters from this file and the output should be as follows -
a
b
c
d
e
f
Can you please help me on this? I'm using KSH script. (18 Replies)
Hi
How can I extract sequences from a fasta file with respect a certain criteria? The beginning of my file (containing in total more than 1000 sequences) looks like this:
>H8V34IS02I59VP
SDACNDLTIALLQIAREVRVCNPTFSFRWHPQVKDEVMRECFDCIRQGLG
YPSMRNDPILIANCMNWHGHPLEEARQWVHQACMSPCPSTKHGFQPFRMA... (6 Replies)
Discussion started by: Marion MPI
6 Replies
LEARN ABOUT PHP
rsort
RSORT(3) 1 RSORT(3)rsort - Sort an array in reverse orderSYNOPSIS
bool rsort (array &$array, [int $sort_flags = SORT_REGULAR])
DESCRIPTION
This function sorts an array in reverse order (highest to lowest).
PARAMETERS
o $array
- The input array.
o $sort_flags
- You may modify the behavior of the sort using the optional parameter $sort_flags, for details see sort(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
rsort(3) example
<?php
$fruits = array("lemon", "orange", "banana", "apple");
rsort($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val
";
}
?>
The above example will output:
0 = orange
1 = lemon
2 = banana
3 = apple
The fruits have been sorted in reverse alphabetical order.
NOTES
Note
This function assigns new keys to the elements in $array. It will remove any existing keys that may have been assigned, rather than
just reordering the keys.
SEE ALSO arsort(3), krsort(3), The comparison of array sorting functions.
PHP Documentation Group RSORT(3)