Sponsored Content
Full Discussion: sort on fields
Top Forums Shell Programming and Scripting sort on fields Post 302127848 by Shell_Life on Thursday 19th of July 2007 09:34:53 PM
Old 07-19-2007
See if this works for you:
Code:
sort -t'|' -k1.1,1.3 -k1.14,1.16 input_file


Last edited by Shell_Life; 07-20-2007 at 03:50 PM.. Reason: Forgot to surround vertical bar with single quotes.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sort fields

I have a large csv file that looks like this: 14 ,M0081,+000000001,200302,+00000100500, 14 ,M0081,+000000004,200301,+00000100500, 14 ,M0081,+000000005,200305,+00000100500, 14 ,M0081,+000000000,200205,+00000100500, 14 ,M0081,+000000008,200204,+00000100500, ... (2 Replies)
Discussion started by: edog
2 Replies

2. Shell Programming and Scripting

sort sum fields

HI ALL, i have a problem when i do a sort sum with many fields. Is there a limit for fields? Do you know a solution? thanks in advance. the shell is: # SORT1 SORT1_rcode=777 if ; then echo "USE $DARSEQ/OTPU.FTPEPREC RECORD F,1000 " > $DARPARSRT/TPEKL508.SORT1_$$.srt ... (6 Replies)
Discussion started by: tullo
6 Replies

3. Shell Programming and Scripting

Sort complicated two fields

Hi experts, I am trying sort command with my data but still not getting the expected results. For example, I have 5 fields data here c,18:12:45,c,c,c d,12:34:34,d,d,d a,13:50:10,a,a,a b,13:50:50,b,b,b a,13:50:50,a,a,a b,14:10:01,b,b,b c,10:12:45,c,c,c I want to get ... (3 Replies)
Discussion started by: lalelle
3 Replies

4. UNIX for Dummies Questions & Answers

sort on three fields

Hi I would like to sort a csv file. It has 50 fields and approx 1400000 lines. I want to sort by three columns as follows. Say sort on coulmn 5, if entries are equal sort on column 3 if this is also equal sort on column 6. It seems that this is possible for 5 then 3 i.e. sort -t "," -k 5,5 -k... (1 Reply)
Discussion started by: turquoise_man
1 Replies

5. UNIX for Dummies Questions & Answers

Sort on first two fields -only-

Hey, I have a file i want to sort. It contains these kind of lines: FirstName LastName buyID buyType Eg: John Doe 22 Car Jane Simpson 4 Headset John Doe 11 Telephone Now if I use the sort command on it cat purchases.txt | sort -k1,1 -k2,2 it would also sort the third and 4th field:... (4 Replies)
Discussion started by: ce3c
4 Replies

6. Shell Programming and Scripting

Unique sort with two fields

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)
Discussion started by: dealerso
3 Replies

7. Shell Programming and Scripting

Unique sort with three fields

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)
Discussion started by: dealerso
3 Replies

8. Shell Programming and Scripting

doing a sort on first two fields

hi, i'm having a file stg_ff.txt which contains 10 fields,which contains millions of records i need to cat the first 10 rows in the file after doing a sorting on the first two fields i n the file. can any body help me on this. regards Angel (4 Replies)
Discussion started by: angel12345
4 Replies

9. Shell Programming and Scripting

Sort on first fields only

Please advice in this. Input file 100,vvvt 201,unb 100,sos 301,abc 99,gang desired output 99,gang 100,vvvt 100,sos 201,unb 301,abc Means if first fields are same ( here 100) the do not sort. (4 Replies)
Discussion started by: theshashi
4 Replies

10. Shell Programming and Scripting

awk sort based on difference of fields and print all fields

Hi I have a file as below <field1> <field2> <field3> ... <field_num1> <field_num2> Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields. I tried this and it doesn't sort on the difference field .. Appreciate your help. cat... (9 Replies)
Discussion started by: newstart
9 Replies
aylet(1)							  Music Software							  aylet(1)

NAME
aylet, xaylet - play Spectrum `.ay' music files SYNOPSIS
aylet/xaylet [-BehlmnNsS] [-A stopafter] [-F fadetime] [-t tracknum] [file1 [file2 ... ]] DESCRIPTION
aylet plays music files in the `.ay' format. These files are essentially wrappers around bits of Z80 code which play music on the Sinclair ZX Spectrum 128's sound hardware - the beeper, or the AY-3-8912 sound chip, or both. Files using the Amstrad CPC ports are also supported. `aylet' has a curses-based interface, and `xaylet' has an X-based one. OPTIONS
-A set stop-after time in seconds (this is the time at which tracks start fading out), or 0 to disable fading. The default is 180 sec- onds (3 minutes). -B use `ABC' stereo positions, rather than the default `ACB'. ACB effectively pushes channels A and B to the left and right (using a stereo delay), with C remaining central; ABC puts A and C to the left/right instead, leaving B central. -e force 8-bit playback, even if 16-bit is available. -F set fade-out time in seconds (the time tracks take to fade out). The default is 10 seconds. -h give terse usage help. -l list the contents of files (track names etc.) rather than playing them. -m use mono rather than the default stereo playback. -n rather than the usual interface, use a simple batch-playing tty style, a bit like mpg123. (Only works in the curses version.) -N use `narrow' stereo separation (so the channels sound closer together) rather than the default `wide' separation. -s output sample data to stdout rather than playing it; implies `-n'. The sample is 44.1kHz 16-bit stereo (or mono if using `-m'). Don't be surprised if the sample takes a little while to generate, as it still has to emulate the Z80. -S apply a pseudo-stereo effect to the beeper output. Works well in some cases, but can make things sound a bit shaky (or rather, more so than usual :-)). -t play only the specified track, then exit. (Strictly speaking, it starts playing the given track, and exits when any track fades out.) Mainly useful when playing a single file non-interactively. file1 etc. the file(s) to play. Currently these can only be specified on the command-line. BEHIND THE SCENES
The way aylet works may seem a little strange if you're not familiar with how the `.ay' format goes about things, so here's some background on how it all works. As mentioned above, the files basically contain chunks of machine code to run on an emulated Z80 with certain sound hardware. Since you're just running a program, you can't really fast-forward or rewind as such, but you can move between tracks specified in the file. (Some files only have one, but others have several.) The whole just-running-a-program thing leads to two other problems, too. You can't tell where a track ends, other than to see when the sound stops; what aylet does is to exit a track after 4 seconds of total silence. And a track may never end at all; aylet fades it out after 3 minutes by default. (Yes, 3 minutes be may too soon to allow some tracks to `finish', but you have to strike the balance somewhere, and it's only a default. Use `-A' or press `s' to change it.) KEYS
Both the curses-based and X-based interfaces use these keys (some of which are based on those used by XMMS): q or Esc exit the program. z previous track. x play. c pause. v stop. b next track. r restart track. Backspace or Delete previous file. Space next file. s increase stop-after time. S decrease stop-after time. Setting it to zero disables fading completely. f increase fade-out time. F decrease fade-out time. h enable/disable high-speed mode, playing four times as fast when enabled (in a way), as a sort of substitute for a real fast-forward control. In xaylet, you can also use the matching buttons for most of the above. When using `aylet -n', the interactivity is scaled down dramatically, leaving just the one control: Ctrl-C if the current track has been playing for less than half a second, exit the program; otherwise, skip to the next track. Note that the key used to do this is really whatever you have set up to generate a SIGINT signal, but it's generally Ctrl-C. EXAMPLES
To play all .ay files in the current directory: aylet *.ay or xaylet *.ay To convert ysfollin.ay to a mono sample in .wav format (requires `sox'): aylet -sm ysfollin.ay |sox -r 44100 -t sw - tune.wav BUGS
The AY is probably too loud relative to the beeper. This may be fixed in the next version, though it's more likely to be an option to choose between the current more reasonable balance and the real thing. :-) Several options which it could reasonably allow to be changed at runtime (e.g. AY stereo, beeper stereo, ACB vs. ABC) can't be at the moment. The X version is currently a bit too much like the curses one, at the expense of GUIness in some respects. SEE ALSO
fuse(1) AUTHOR
Russell Marks (rus@svgalib.org). The Z80 emulation was written by Ian Collier, for xz80. Chris Cox wrote the OpenBSD sound code. Matan Ziv-Av was partly responsible for the OSS sound code. Version 0.4 1st October, 2004 aylet(1)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy