Sponsored Content
Full Discussion: sort command
Top Forums UNIX for Dummies Questions & Answers sort command Post 302144883 by aldomenico on Sunday 11th of November 2007 10:25:55 AM
Old 11-11-2007
Wrong order of arguments - try this

At least in SUSE, the sort command is like this:

sort [OPTIONS] ... [FILE]

you had the file before the options.

Try this instead (it worked for me):

sort -k 21 -o file_2 -r file_1

Option r (reverse order) is used because otherwise it was sorting in Descending mode. In option k, the top limit is optional, and so it is not needed if you are sorting with one character only.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with the Sort command

Can someone please tell me how to sort a file, based on a particular position within the file? I have a line sequential file that is 152 bytes per record, in which i need to sort the file based on the numeric data in positions 142-152. I have done the "man sort" command and see the -k option... (1 Reply)
Discussion started by: rjjenkin
1 Replies

2. UNIX for Dummies Questions & Answers

sort command

Hi, I am going to sort a huge flat file using sort command, this file is about 36 million lines, 179 fields delimitered by Ctrl B (002). eg. 1^B198709..... 17^B200301.... 3^B196511.... ..... I want this file being sorted by the first field, the result is like : 1^B198709........ (2 Replies)
Discussion started by: xli
2 Replies

3. UNIX for Dummies Questions & Answers

sort command...

Hi IŽd like to get a few explanations about how the sort command works when cascading the options. cscyabl@comet:(develop)> more file 2:A2 2:A1 5:A2 5:A2 10:A1 cscyabl@comet:(develop)> sort -n -u file 2:A1 5:A2 10:A1 cscyabl@comet:(develop)> sort -u -n file 2:A1 5:A2 10:A1... (8 Replies)
Discussion started by: Indalecio
8 Replies

4. Shell Programming and Scripting

Need help with sort command

Hi i have a file containing ip addresses and want to sort those IP addresses in the ascending order. file (match.txt) contents are: 192.168.0.100 192.168.0.16 192.168.0.10 192.168.0.23 192.168.0.2 192.168.0.3 192.168.0.1 192.168.0.222 i tried: sort -n match.txt output is :... (3 Replies)
Discussion started by: manmeet
3 Replies

5. Shell Programming and Scripting

How to Sort Floating Numbers Using the Sort Command?

Hi to all. I'm trying to sort this with the Unix command sort. user1:12345678:3.5:2.5:8:1:2:3 user2:12345679:4.5:3.5:8:1:3:2 user3:12345687:5.5:2.5:6:1:3:2 user4:12345670:5.5:2.5:5:3:2:1 user5:12345671:2.5:5.5:7:2:3:1 I need to get this: user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Discussion started by: daniel.gbaena
7 Replies

6. Homework & Coursework Questions

Sort command

I have file ipaddress.txt 192.168.1.25 127.3.9.12 192.168.12.1 127.21.2.3 127.92.80.6 192.168.4.5 I want to sort as 127.3.9.12 127.21.2.3 127.92.80.6 192.168.1.25 192.168.12.1 192.168.4.5 So what sort command do I have to use. (1 Reply)
Discussion started by: RiderOnsky
1 Replies

7. Shell Programming and Scripting

Is it Possible to sort a list of hexadecimal numbers using "sort" command?

Hello Everybody :) !!!. i have question in mind, is it possible to sort a list of hexadecimal numbers using "sort" command? (9 Replies)
Discussion started by: Kesavan
9 Replies

8. Shell Programming and Scripting

Help with sort command

I have a file with the following content:- 181268525,0640613864,B,113,22-dec-2011 14:12:08, 181268525,0640613864,C,113,25-dec-2011 14:18:50, 181268525,0640613864,L,113,26-dec-2011 14:07:46, 181268525,0640613864,X,113,01-jan-2012 16:57:45, 181268525,0640613864,X,113,04-jan-2012 14:13:27,... (3 Replies)
Discussion started by: Yoda
3 Replies

9. Shell Programming and Scripting

Help to sort out... Possible use of sort command

I have an input like 4.3.6.66 4.3.6.67 4.3.6.70 4.3.6.25 4.3.6.15 4.3.6.54 4.3.6.44 4.3.6.34 4.3.6.24 4.3.6.14 4.3.6.53 4.3.6.43 4.3.6.49 4.3.6.33 4.3.6.52 4.3.6.19 4.3.6.58 4.3.6.42 (5 Replies)
Discussion started by: dnam9917
5 Replies
MTKBABEL(1)						      General Commands Manual						       MTKBABEL(1)

NAME
mtkbabel - Tool for managing GPS data loggers based on the MTK chip SYNOPSIS
mtkbabel [-abcdEfhiIlmopRrstvwx] DESCRIPTION
mtkbabel is a command line program to operate GPS data loggers based on the MediaTek MTK chip. It was tested on the i-Blue 747, Qstarz BT- Q1000 and on the Holux M-241, it should work also with other GPS devices based on the same chip. The main features are: - Command line interface - Save data log in GPX and raw binary format - If required retrieve all the data, also the old one being overlapped - Change logging criteria: time, distance, speed - Change log format - START/STOP logging - Set OVERLAP or STOP method on memory full - Erase the internal memory USAGE
In order to use mtkbabel, please follow these instructions: 1. Attach the GPS data logger device to your computer via USB. 2. Now you have to switch the GPS device (at least the i-Blue 747) into LOG or NAV mode, otherwise the device will not be powered on, and no connection will be possible. Beware that in NAV mode the device goes into sleep mode if not connected to any Bluetooth device. 3. In order to use mtkbabel you have to either be root (not recommended) and/or you must have read/write permissions for the USB device file, usually /dev/ttyUSB0. This device usually has permissions 'crw-rw---- 1 root dialout', so you can either add your user to the dialout group (in this example) by doing $ adduser USERNAME dialout or (not recommended) make the device world-readable/-writable by doing: $ chmod 666 /dev/ttyUSB0 Another option is to write a udev rules file to change the owner and permissions of /dev/ttyUSB0 according to your requirements. 4. You can now run mtkbabel. For example, if you want to download the track log and the list of waypoints you captured on the device, run: $ mtkbabel -s 115200 -l off -f foo -w -t The default speed of 115200 baud should work in most cases and you can omit it, for the Holux M-241 you must use 38400 instead. This will turn off the autolog function, which is always turned on when you switch on the device. The track log will be in the file foo_trk.gpx, the waypoints in the file foo_wpt.gpx (both in GPX format). The file foo.bin will contain the binary log file. Downloading the data from the GPS device can take several minutes, depending on how much data has to be transferred. In order to delete all data from the GPS device, run: $ mtkbabel -s 115200 -E OPTIONS
-a Read all the log memory (overlapped data). -b filename.bin Do not read data from a GPS device, but rather read a previously saved .bin file. Ignore -f option. -c Create a GPX file with both tracks and waypoints. -d debug_level Debug level: 0..7. -E Erase data log memory. -f Base name for saved files (.bin and .gpx). If you, for example, use -f gpslog, mtkbabel will create files which are called gpslog.gpx, gpslog_trk.gpx, gpslog_wpt.gpx and gpslog.bin. -h Show a help text and exit. -i Ignore some error conditions and try to extract as much data as possible from GPS. -I Same as -i, but also write bad records into the GPX file. -l {on|off} Turn logging ON/OFF. -m {stop|overlap} Set STOP/OVERLAP recording method on memory full. -o log_format Enable or disable log fields (FIELD1,-FIELD2,...), available fields: UTC, VALID, LATITUDE, LONGITUDE, HEIGHT, SPEED, HEADING, DSTA, DAGE, PDOP, HDOP, VDOP, NSAT, SID, ELEVATION, AZIMUTH, SNR, RCR, MILLISECOND, DISTANCE. -p port Communication port, default: /dev/ttyUSB0. -R Recover from disabled log: erase data and reset recording criteria. -r time:distance:speed Set logging criteria (zero to disable): every 0.10-9999999.90 seconds, every 0.10-9999999.90 meters, over 0.10-9999999.90 km/h. Not all the devices support such wide ranges, more reasonable values are 1-999 seconds, 10-9999 meters and 10-999 km/h. -s speed Serial port speed, default 115200 baud. -t Create a GPX file with tracks. -v Show version information and exit. -w Create a GPX file with waypoints. -x Force reading Holux format. This is required to read-back the binary data produced by some Holux devices, which do not embed into the data itself the Holux identifier string. BUGS
Please report any bugs to Niccolo Rigacci <niccolo@rigacci.org>. LICENCE
mtkbabel is covered by the GNU General Public License (GPL), version 2 or later. AUTHORS
Niccolo Rigacci <niccolo@rigacci.org> This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>. It is licensed under the terms of the GNU GPL (version 2 or later). July 30, 2011 MTKBABEL(1)
All times are GMT -4. The time now is 04:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy