Sponsored Content
Full Discussion: Sorting a list
Top Forums UNIX for Dummies Questions & Answers Sorting a list Post 302587674 by kristinu on Thursday 5th of January 2012 01:40:58 PM
Old 01-05-2012
I will complicate it a little more, so files are sorted according to increasing values of the tags

For the drw tag (e.g for 4x3drw, 8x6drw, and, 16x12drw) , I multiply the two numbers. For example 4*3=12, 8*6=48, and 16*12=192. Thus I first sort using 4x3drw, then 8x6drw, and finally by 16x12drw. Then for all files having 4x3drw, I look at the value in the dc tag. Example dc0.1 files will be grouped before ones with dc0.8.

Basically it is a bit more structured than the current solution.
 

10 More Discussions You Might Find Interesting

1. Programming

Sorting in C++..

Hi, I need to do a sorting of 2 arrays. One array contains the values of both integer and character and other array can be anything. For example: Array={'1L','2C','NULL','23L','11L','4C','10L','9C'} Array= {'01-02-13-1x','02-11-23-3s','00-12-13-5f','NULL','22k',} If any of these arrays... (6 Replies)
Discussion started by: ronix007
6 Replies

2. UNIX for Advanced & Expert Users

help with sorting sequence in Unix C:sort -t ':' +0 -1 -n +1 -2 +2 -3 -o list list

Hi List is 000|2008-07-17|556543|RTJ|35-RTGJ|EYT 465|2008-11-10|567789|GHJ|45-DGHH|ETU 533|2008-09-06|567789|GHJ|45-DGHH|ETU How does it do it? sort -t ':' +0 -1 -n +1 -2 +2 -3 -o list list (6 Replies)
Discussion started by: gurvinder
6 Replies

3. UNIX for Dummies Questions & Answers

Sorting list of files per date column

Hi all, I have a pecular issue in sorting these files (not an ls -lrt) in Solaris environment. All the below files are modified on November 4th, but I want to sort these files as per date (eg: 01May07_1623 = ddmmmyy_hhmm) Nov 4 18:27 SONYELEC00.GI22973.01May07_1623.gpg Nov 4 18:27... (10 Replies)
Discussion started by: shivaastrogun
10 Replies

4. Shell Programming and Scripting

Splitting a list @list by space delimiter so i can access it by using $list[0 ..1..2]

EDIT : This is for perl @data2 = grep(/$data/, @list_now); This gives me @data2 as Printing data2 11 testzone1 running /zones/testzone1 ***-*****-****-*****-***** native shared But I really cant access data2 by its individual elements. $data2 is the entire list, while $data,2,3...... (1 Reply)
Discussion started by: shriyer
1 Replies

5. Shell Programming and Scripting

Sorting a list of filenames but keeping the path information.

Hi All I've googled around for this and can't see a way of doing it. I have a file that contains a number of records that are layed out something like the following. /path/to/directory/that/contains/a/file/I/need/filename.pdf The path itself can vary both in terms of the names and the... (7 Replies)
Discussion started by: Bashingaway
7 Replies

6. Shell Programming and Scripting

Perl: Sorting a hash value that is a list.

Hi Folks I am very much a newbie at perl but picking it up and I'm hoping you can help. I have a file input that details all the /etc/group files in our enterprise in the following format: "<host>:<group>:<gid>:<users>" I want to parse this data display it as the following:... (9 Replies)
Discussion started by: g_string
9 Replies

7. Shell Programming and Scripting

Sorting a list

I am trying to sort a list If you walk through the list, every you have passed both website1 and website2 and get back to website1, the last lines should be collected into one line and the process should start again. The following: http://www.website1.com http://www.website1.com... (2 Replies)
Discussion started by: locoroco
2 Replies

8. Shell Programming and Scripting

Sorting a list of words one per line by their ending

Hello, My OS is Windows and therefore DOS. Hence I have no access to Unix tools. I am trying to sort a file in Urdu by the character by which it ends. Each word is on a separate line. As input, an example in English would help: fruit banana apple pear house I need the sort to be on the... (5 Replies)
Discussion started by: gimley
5 Replies

9. Shell Programming and Scripting

Sorting with list, - 2 lists next to 200

Hi I was wondering if anyone knew the best way to have files displayed by list so that they were in numerical order? the problem I am having is I am using the ls and the head command to sort a group of 500 files into manageable 133 file bunches and transfer them to another directory were they will... (4 Replies)
Discussion started by: Paul Walker
4 Replies

10. Shell Programming and Scripting

List the files after sorting based on file content

Hi, I have two pipe separated files as below: head -3 file1.txt "HD"|"Nov 11 2016 4:08AM"|"0000000018" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" head -3 file2.txt "HD"|"Nov 15 2016 2:18AM"|"0000000019" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" I want to list the... (6 Replies)
Discussion started by: Prasannag87
6 Replies
ctags(1)						      General Commands Manual							  ctags(1)

NAME
ctags - create a tags file SYNOPSIS
files ... DESCRIPTION
makes a tags file for ex(1) (or vi(1)) from the specified C, Pascal and FORTRAN sources. A tags file gives the locations of specified objects (for C, functions, macros with argments, and typedefs; Pascal, procedures, programs and functions; FORTRAN, subroutines, programs and functions) in a group of files. Each line of the tags file contains the object name, the file in which it is defined, and an address specification for the object definition. Output is sorted in ascending collation order (see Environment Variables below). All objects except C typedefs are searched with a pattern, typedefs with a line number. Specifiers are given in separate fields on the line, separated by spaces or tabs. Using the tags file, can quickly find these objects' definitions. Cause to print a simple function index. This is done by assembling a list of function names, file names on which each function is defined, the line numbers where each function name occurs, and the text of each line. The list is then printed on the stan- dard output. No tags file is created or changed. Produce a page index on the standard output. This listing contains the function name, file name, and page number within that file (assuming 56-line pages to match pr(1)). Files whose name ends in or are assumed to be C source files and are searched for C routine and macro definitions. Others are first exam- ined to see if they contain any Pascal or FORTRAN routine definitions; if not, they are processed again looking for C definitions. Other options are: Use forward searching patterns (default). Use backward searching patterns Add the information from the files to the tags file. Unlike re-building the tags file from the original files, this can cause the same symbol to be entered twice in the tags file. This option should be used with caution and then only in very special circumstances. Create tags for typedefs. Suppress warning diagnostics. Update the specified files in tags; that is, all references to those files are deleted, and the new values are added to the file as in above. (Beware: this option is implemented in a way which is rather slow; it is usually faster to simply rebuild the tags file.) The tag is treated specially in C programs. The tag formed is created by adding to the beginning of name of the file, with any trailing removed, and leading pathname components also removed. This makes use of practical in directories with more than one program. EXTERNAL INFLUENCES
Environment Variables determines the order in which the output is sorted. determines the interpretation of the single- and/or multi-byte characters within comments and string literals. If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of ``C'' (see lang(5)) is used instead of If any internationaliza- tion variable contains an invalid setting, behaves as if all internationalization variables are set to ``C''. See environ(5). International Code Set Support Single- and multi-byte character code sets are supported with the exception that multi-byte character file names are not supported. DIAGNOSTICS
An attempt to get additional heap space failed; the sort could not be performed. The tags file may be incorrect. A character was found unexpectedly in the first column. This can lead to incorrect entries in the tags file. The same name was detected twice in the same file. A tags entry was made only for the first name found. The same name was detected in two different files. A tags entry was made only for the first name found. EXAMPLES
Create a tags file named in the current directory for all C source files and all header files in the current directory: Once the tags file exists in the current directory, it can be used with commands that support tag files (such as (see vi(1)). Use the tags file with to edit a particular function located in one of the source files: While editing a C source file using use the tag command to edit function Use to find in file While using find in file (does not have to be the file currently being edited): WARNINGS
Recognition of and for FORTRAN and Pascal is done in a very simple way. No attempt is made to deal with block structure; if there are two Pascal procedures in different blocks with the same name, a warning message is generated. The method of deciding whether to look for C or Pascal and FORTRAN functions is an approximation, and can be fooled by unusual programs. does not know about and Pascal types. It relies on the input being well formed to detect typedefs. Use of shows only the last line of typedefs. is naive about tags files with several identical tags; it simply chooses the first entry its (non-linear) search finds with that tag. Such files can be created with either the or options or by editing a tags file. If more than one (function) definition appears on a single line, only the first definition is indexed. AUTHOR
was developed by the University of California, Berkeley. FILES
output tags file temporary file used by SEE ALSO
ex(1), vi(1). STANDARDS CONFORMANCE
ctags(1)
All times are GMT -4. The time now is 08:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy