tags:

views:

85

answers:

3

Anyone knows how this sort works? What do they [+0.2 -0.42 +0.0 -0.1 -o] mean?

CmdString.Format("sort -u +0.2 -0.42 +0.0 -0.1 -o %s %s",
(const char *)TempFilename,
(const char *)TempFilename);
A: 

The "-o" is the parameter to define the output file. The rest of the + and - are defining the fields, and offsets in those fields to sort by. The manual page for sort will give all the gory details...

Chris J
+1  A: 

-u option remove duplicate lines.

+f.c and -f.c define sorting keys:

  • f represents a field number
  • c represent a character number within the field from the beginning of the field when starting with + or from the end of the previous field when starting with -

Take a look at sort man page for more precisions about it.

mouviciel
A: 

An info coreutils 'sort invocation' command reveals that on older systems sort uses an obsolete +POS1 [-POS2] origin-zero syntax for specifying sort keys.

In my opinion, though, the info page is not much more helpful than the man page, which is why there hasn't been much explanation so far, beyond a hint that the man page will help.

pavium