Hi,
May I know, if a pipe separated File is large, what is the best method to calculate the unique row count of 3rd column and get a list of unique value of the 3rdcolum?
Thanks in advance! (20 Replies)
Hi all,
I've searched the forum and I can find some code to sort uniquely in perl but not by a single field.
I have a file with data such as the following:
1,test,34
1,test2,65
2,test,35,
1,test3,34
2,test,34
What i want to do is sort it uniqely by the first field only so I'd end... (2 Replies)
Hi all,
I am writing a script where i can parse through the directory and get common string in two directories i get. The command below SUN_PLATFORM=`$FIND $STREAM_PATH . -depth -name ShareableEntities | $AWK -F"/" '{if($10 ~ /sun5/) print $0}'` gives the following output:-
... (1 Reply)
Input file
---------
12:name1:|host1|host1|host2|host1
13:name2:|host1|host1|host2|host3
14:name3:
......
Required output
---------------
12:name1:host1(2)|host1(1)
13:name2:host1(2)|host2(1)|host3(1)
14:name3:
where (x) - Count how many times field appears in last column
... (3 Replies)
I have a file with contents below
123,502
123,506
123,702
234,101
235,104
456,104
456,100
i want to sort such that i get a unique value in column A, and for those with multiple value in A, i want the lowest value in B.
output should be
123,502
234,101
235,104
456,100 (3 Replies)
I have another file with three columns A,B,C as below
123,1,502
123,2,506
123,3,702
234,4,101
235,5,104
456,6,104
456,7,100
i want to sort such that i get a unique value in column A, and for those with multiple value in A, i want the lowest value in C.
output should be
Code:... (3 Replies)
Hi,
I am modifying a file with sed command. i want to make SCORE= blank in the file whereever SCORE=somevalue.
What will *$ do in the below command?
cat $file | sed 's/SCORE=.*$/SCORE=\r/g' > newfile
The last line is also missing in the new file. How to make SCORE='100' to SCORE=... (5 Replies)
Hi, this is about sorting a very large file (like 10 gb) to keep lines with unique entries across SOME of the columns.
The line originally looked like this:
sort -u -k2,2 -k3,3n -k4,4n -k5,5n -k6,6n file_unsorted > file_sorted
please note the -u flag.
The problem is that this single... (4 Replies)
I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Hi,
I have an input file that I have sorted in a previous stage by $1 and $4. I now need something that will take the first record from each group of data based on the key being $1
Input file
1000AAA|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|AA
1000AAA|"ZZZ"|"Date"|"2"|"Y"|"ABC"|""|AA... (2 Replies)
Discussion started by: Ads89
2 Replies
LEARN ABOUT DEBIAN
dahdi_registration
DAHDI_REGISTRATION(8) User Contributed Perl Documentation DAHDI_REGISTRATION(8)NAME
dahdi_registration - Handle registration of Xorcom XPD modules in dahdi.
SYNOPSIS
dahdi_registration [-s sortorder] [on|off]
DESCRIPTION
Without parameters, show all connected XPDs sorted by physical connector order. Each one is show to be unregistered (off), or registered
to a specific dahdi span (the span number is shown).
All registerations/deregisterations are sorted by physical connector string.
Span registration should generally always succeed. Span unregistration may fail if channels from the span are in use by e.g. asterisk. In
such a case you'll also see those channels as '(In use)' in the output of lsdahdi(8).
Parameters
off -- deregisters all XPD's from dahdi.
on -- registers all XPD's to dahdi.
Options
-s sort_order
The sort order to use.
If the option is not used, the sort order is taken from the environment variable XBUS_SORT and failing that: the hard-coded default of
SORT_XPPORDER.
The available sorting orders are documented in Dahdi::Xpp manual.
Sample Output
An example of the output of dahdi_registration for some registered Astribanks:
$ dahdi_registration -s type
XBUS-01 usb:0000153 usb-0000:00:10.4-2
XBUS-01/XPD-00: on Span 1
XBUS-01/XPD-01: on Span 2
XBUS-00 usb:0000157 usb-0000:00:10.4-4
XBUS-00/XPD-00: on Span 3
XBUS-00/XPD-01: on Span 4
XBUS-00/XPD-02: on Span 5
XBUS-00/XPD-03: on Span 6
XBUS-00/XPD-04: on Span 7
XBUS-00/XPD-05: on Span 8
XBUS-00/XPD-06: on Span 9
XBUS-00/XPD-07: on Span 10
XBUS-02 usb-0000:00:10.4-1
XBUS-02/XPD-00: on Span 11
XBUS-02/XPD-10: on Span 12
# Sorted: type
FILES
/proc/xpp/XBUS-nn/XPD-mm/dahdi_registration
Reading from this file shows if if the if the specific XPD is registered. Writing to it 0 or 1 registers / unregisters the device.
This should allow you to register / unregister a specific XPD rather than all of them.
perl v5.14.2 2011-07-11 DAHDI_REGISTRATION(8)