I have a group of files that I need to be sorted by number. I have tried to use the sort command without any luck.
I have tried ls includes* |sort -n and I have tried sorting by field. I then tried sort -r to see if the order would reverse. None of these commands changes the order. includes10 includes11 and includes12 should be at the end of these files not at the beginning. Any ideas as to how to accomplish this?
Hi all,
In unix shell, I want to get two strings ending with "." and starting with "." from a string "chan.txt"
For example, a string "chan.txt".
The first string is "chan"
The second string is "txt"
Yours
Wilson (1 Reply)
Hi all,
Iam trying to sort the contents of the file based on the position of the file.
Example:
$cat sample.txt
0101020060731 ## Header record
1c1 Berger Awc ANP20070201301 4000.50
1c2 Bose W G ANP20070201609 6000.70
1c2 Andy CK ANP20070201230 28000.00... (3 Replies)
I could really use some help with this issue. I'm having a lot of trouble getting my sed command to delete only the lines from my file that end with _;
I'm also supposed to carry the leading 'c' down to the next line. The commands I've tried either delete everything or nothing at all. Any help... (12 Replies)
Hi
I have a "set" command which ends with a "." (dot), for example:
set `grep "\<${pnum}\>" /tstmp/data.txt |sed 's/#//'` .
Can somebody help me to understand the purpose of this "set" and "." combination?
The problem is that this command does not produce the same result when run on AIX... (2 Replies)
I need to sort the following file by the rhdiskpower devices in the last column:
Total_MB Free_MB OS_MB Name Failgroup Library Label UDID Product Redund Path
1024 851 1024 OCRVOT1_0000 OCRVOT1_0000 System UNKNOWN ... (3 Replies)
hi,
please can I ask you for some help? I have data from 3D situation, x y z value
I'd like to use gnuplot to generate maps of the value in the planes z=0 to z=1 for example, my file looks
like
-0,012 0,0060 0,0 0,13972813076023477
-0,012 0,0064319163 4,2894483E-4 ... (1 Reply)
Hello All,
I have a scenario to read a file containing text like this:(say file name is Dummy.txt)
/home/abc/test1/ | file1
/home/abc/test2/ | file2
I used a variable to store the content from file like this (say for line1):
File=`head -1 Dummy.txt | cut -f1 -d "|"`
Dir=`head -1 Dummy.txt... (2 Replies)
I am trying to find out which files in a group of files have lines ending in r. What I have is this:
cat /tmp/*RECORDS| if grep r$>/dev/null; then echo "yes";else echo"no";fi
Records is more than one file. There are the following files
TEST-RECORDS
/volume/testing
/volume/programs
... (2 Replies)
Hi All,
I have 2 pipe delimited files viz., file_old and file_new. I'm trying to compare these 2 files, and extract all the different rows between them into a new_file.
comm -3 < sort file_old < sort file_new > new_file
I am getting the below error:
-ksh: sort: cannot open
But if I do... (7 Replies)
Discussion started by: njny
7 Replies
LEARN ABOUT OSX
sort
SORT(1) User Commands SORT(1)NAME
sort - sort lines of text files
SYNOPSIS
sort [OPTION]... [FILE]...
DESCRIPTION
Write sorted concatenation of all FILE(s) to standard output.
Mandatory arguments to long options are mandatory for short options too. Ordering options:
-b, --ignore-leading-blanks
ignore leading blanks
-d, --dictionary-order
consider only blanks and alphanumeric characters
-f, --ignore-case
fold lower case to upper case characters
-g, --general-numeric-sort
compare according to general numerical value
-i, --ignore-nonprinting
consider only printable characters
-M, --month-sort
compare (unknown) < `JAN' < ... < `DEC'
-n, --numeric-sort
compare according to string numerical value
-r, --reverse
reverse the result of comparisons
Other options:
-c, --check
check whether input is sorted; do not sort
-k, --key=POS1[,POS2]
start a key at POS1, end it at POS2 (origin 1)
-m, --merge
merge already sorted files; do not sort
-o, --output=FILE
write result to FILE instead of standard output
-s, --stable
stabilize sort by disabling last-resort comparison
-S, --buffer-size=SIZE
use SIZE for main memory buffer
-t, --field-separator=SEP
use SEP instead of non-blank to blank transition
-T, --temporary-directory=DIR
use DIR for temporaries, not $TMPDIR or /tmp; multiple options specify multiple directories
-u, --unique
with -c, check for strict ordering; without -c, output only the first of an equal run
-z, --zero-terminated
end lines with 0 byte, not newline
--help display this help and exit
--version
output version information and exit
POS is F[.C][OPTS], where F is the field number and C the character position in the field. OPTS is one or more single-letter ordering
options, which override global ordering options for that key. If no key is given, use the entire line as the key.
SIZE may be followed by the following multiplicative suffixes: % 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y.
With no FILE, or when FILE is -, read standard input.
*** WARNING *** The locale specified by the environment affects sort order. Set LC_ALL=C to get the traditional sort order that uses
native byte values.
AUTHOR
Written by Mike Haertel and Paul Eggert.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of the GNU General Public License
<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for sort is maintained as a Texinfo manual. If the info and sort programs are properly installed at your site, the
command
info sort
should give you access to the complete manual.
sort 5.93 November 2005 SORT(1)