Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sort command, more than one delimiter Post 302937031 by newbie2010 on Monday 2nd of March 2015 05:58:48 PM
Old 03-02-2015
Sort command, more than one delimiter

I have the following file:
Code:
/vol/labor_vol1
/vol/labor_vol10
/vol/labor_vol11
/vol/labor_vol12
/vol/labor_vol13
/vol/labor_vol14
/vol/labor_vol15
/vol/labor_vol16
/vol/labor_vol17
/vol/labor_vol18
/vol/labor_vol19
/vol/labor_vol2
/vol/labor_vol22
/vol/labor_vol3
/vol/labor_house
/vol/labor1_vol20
/vol/labor1_vol21
/vol/labor1_vol23
/vol/labor1_vol24
/vol/labor1_vol25
/vol/labor1_vol26
/vol/labor1_vol27

I want to see it sorted like this:

Code:
/vol/labor_vol1
/vol/labor_vol2
/vol/labor_vol3
/vol/labor_vol4
/vol/labor_vol5
/vol/labor_vol6
/vol/labor_vol7
/vol/labor_vol8
/vol/labor_vol9
/vol/labor_vol10
/vol/labor_vol11
/vol/labor_vol12
/vol/labor_vol13
/vol/labor_vol14
/vol/labor_vol15
/vol/labor_vol16
/vol/labor_vol17
/vol/labor_vol18
/vol/labor_vol19
/vol/labor_vol22
/vol/labor_house
/vol/labor1_vol20
/vol/labor1_vol21
/vol/labor1_vol23
/vol/labor1_vol24
/vol/labor1_vol25
/vol/labor1_vol26
/vol/labor1_vol27

Is there a way to do this with sort?
I've tried:
Code:
sort -t '/' -k3.6n,3.10n

and similar combinations without luck
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dynamic delimiter in cut command

hello.. my prob is as follows: i have to read from a file which may have different formats depending upon the delimiter used in the data of the file.now i need that the user input the delimiter.the input delimiter is stored in a variable and is used on cut command to retrieve necessary... (3 Replies)
Discussion started by: tej.buch
3 Replies

2. Shell Programming and Scripting

sort command delimiter

Hello All, I'm trying to use the sort command on a text file, the delimiter used in this file is a non-prining character '\027' I tried to use the command -t option but it's not really working. sort +n4 -t'\027' filename <<-- this is what I was trying and not working. Your help is... (1 Reply)
Discussion started by: Nomaad
1 Replies

3. UNIX for Advanced & Expert Users

How can I use double character delimiter in the cut command

Hi All, Can the cut command have double character delimiter? If yes, how can we use it. if my data file contains : apple || mango || grapes i used cut -f1 -d"||" filename but got an error. Plz help.... Thanks. (1 Reply)
Discussion started by: AshishK
1 Replies

4. 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

5. Shell Programming and Scripting

CUT command delimiter in reverse

Hi, I've a situation where, a=xxx.yyy.zzz.txt EXTN=`echo $a | cut -d . -f2` Using the above code it delimites and will return "yyy.zzz.txt" to EXTN. But i need to get only the extension "txt". so as per the above code it delimits in the first "." itself. Can anyone help how to do... (6 Replies)
Discussion started by: skcvasanth
6 Replies

6. 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

7. Shell Programming and Scripting

sort text having delimiter with "|" (pipe)

i am having text file below NARGU S S 12358 SALES REP |22| Acccount/s RAJU R B 64253 SALES REP |12| Acccount/s RUKMAN S 32588 SALES REP |10| Acccount/s NARGUND S S 12356... (3 Replies)
Discussion started by: suryanarayana
3 Replies

8. UNIX for Dummies Questions & Answers

set output delimiter as tab in cut command

I can not make it work, it prints \t rather than introduce tabs. cut -d "," -f 4,8 Samples.csv --output-delimiter="\t" | sort > out Since I am running this command within a shell script, I tried manually inserting tab in this command, still does not work. I am using bash shell Suggestions... (8 Replies)
Discussion started by: analyst
8 Replies

9. Shell Programming and Scripting

Shell script to put delimiter for a no delimiter variable length text file

Hi, I have a No Delimiter variable length text file with following schema - Column Name Data length Firstname 5 Lastname 5 age 3 phoneno1 10 phoneno2 10 phoneno3 10 sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies

10. Shell Programming and Scripting

Perl Code to change file delimiter (passed as argument) to bar delimiter

Hi, Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters. Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies
mlib_VolumeRayCast_General(3MLIB)			    mediaLib Library Functions				 mlib_VolumeRayCast_General(3MLIB)

NAME
mlib_VolumeRayCast_General, mlib_VolumeRayCast_General_Parallel_Nearest_U8_Bit, mlib_VolumeRayCast_General_Parallel_Nearest_U8_U8, mlib_VolumeRayCast_General_Parallel_Nearest_S16_S16, mlib_VolumeRayCast_General_Parallel_Trilinear_U8_U8, mlib_VolumeRayCast_General_Paral- lel_Trilinear_S16_S16, mlib_VolumeRayCast_General_Divergent_Nearest_U8_Bit, mlib_VolumeRayCast_General_Divergent_Nearest_U8_U8, mlib_Vol- umeRayCast_General_Divergent_Nearest_S16_S16, mlib_VolumeRayCast_General_Divergent_Trilinear_U8_U8, mlib_VolumeRayCast_General_Diver- gent_Trilinear_S16_S16 - cast a ray (or rays) through a 3D data set SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_VolumeRayCast_General_Parallel_Nearest_U8_Bit( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Parallel_Nearest_U8_U8( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Parallel_Nearest_S16_S16( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Parallel_Trilinear_U8_U8( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Parallel_Trilinear_S16_S16( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Divergent_Nearest_U8_Bit( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Divergent_Nearest_U8_U8( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Divergent_Nearest_S16_S16( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Divergent_Trilinear_U8_U8( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); mlib_status mlib_VolumeRayCast_General_Divergent_Trilinear_S16_S16( mlib_rays *rays, const mlib_genvolume *vol, void *buffer); DESCRIPTION
Each of these functions casts a ray (or rays) through a three-dimensional(3D) data set, then computes and returns the interpolated samples at each step along the way. In trilinear interpolation, the value at point P is computed from its eight surrounding neighbors based on the equation below. P = (1-a)*(1-b)*(1-c)*P0 + a*(1-b)*(1-c)*Px + (1-a)*b*(1-c)*Py + (1-a)*(1-b)*c*Pz + a*b*(1-c)*Pxy + a*(1-b)*c*Pxz + (1-a)*b*c*Pyz + a*b*c*Pxyz where a, b, and c are the fractional parts of the coordinates of point P. The trilinear interpolation is represented by the following figure: Printed copy or docs.sun.com displays a figure that represents the trilinear interpolation. In nearest neighbor operation, the sample value at point P is replaced by the value of the nearest neighbor voxel. PARAMETERS
Each of the functions takes the following arguments: rays Casting rays. vol Volume data that consists of slices. buffer Working buffer. RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VolumeRayCast_Blocked(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_VolumeRayCast_General(3MLIB)
All times are GMT -4. The time now is 11:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy