05-17-2010
try this:
ls -1 /c09/oracle/XX_TT/12.0.0/TMP_IN/lms_prap_rf* |awk -F "/" '{print $2}'| sort -t _ -nk4 -k5
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys,
Probably an easy one, but how do you sort a directory so that the files come first, then subdirectories?
ie ./dir1 contains
file 1
subdir 1
file 2
i need it to become
file 1
file 2
subdir 1
as i'm using it in a script to pass each one through a for loop, and would... (2 Replies)
Discussion started by: olimiles
2 Replies
2. UNIX for Dummies Questions & Answers
Hi guys,
Probably an easy one, but how do you sort a directory so that the files come first, then subdirectories?
ie ./dir1 has
file 1
subdir 1
file 2
i need it to become
file 1
file 2
subdir 1
as i'm using it in a script to pass each one through a for loop, and would like all... (3 Replies)
Discussion started by: olimiles
3 Replies
3. UNIX for Dummies Questions & Answers
If I do an ls -l on a directory I get this:
-rw-r--r-- 1 root other 5248094 Jun 24 03:56 monitor.log.7
-rw-r--r-- 1 root other 5248303 Jul 11 11:19 ct.log.1
-rw-r--r-- 1 root other 5248907 Jun 29 06:01 ct_monitor.log.5
-rw-r--r-- 1 root other 5249042 Jun 19... (1 Reply)
Discussion started by: Sepia
1 Replies
4. Shell Programming and Scripting
Hi Guys,
I am very new to Unix.Can anyone tell me how to sort a file based on fields.
For example, I am having a file whose contents are mentioned below:
2233|charles harris |g.m. |sales |12/12/52| 90000 9876|bill johnson |director... (3 Replies)
Discussion started by: mraghunandanan
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a file which has data as
path/1.xml path/2.xml,...(each in separate lines)
I want to sort this file in order. It is not working when I give
"sort filename"
The number of "/" in path can vary.
Thanks,
Floyd (1 Reply)
Discussion started by: asmfloyd
1 Replies
6. Shell Programming and Scripting
I have a text file with full list of files with their full path. I wanted to sort it by directory then files then subdirectory by alphabetically. When I used the sort command it doesn't give like what I want. Could somebody help me on this.
Here is the ex:
This is what I'm getting... (2 Replies)
Discussion started by: javidraaj
2 Replies
7. Shell Programming and Scripting
Hello forum members,
I am writing a script to two tasks.
1: displaying the list of the files in the current directory.
2: removing the specifed file from the list.
I have written a sample script ,so can u please verfiy and correct.
echo Enter list of files
ls *.txt
read textfile
rm -f... (3 Replies)
Discussion started by: sivaranga001
3 Replies
8. Shell Programming and Scripting
I have files with the name
myfile_YYMMDD.txt
I need to sort them by their date stamp. I know this will work.
ls -lrt * | awk '{print $9}' | cut -d "_" -f3 | sort
However, it just returns YYMMDD.txt
I can then append the myfile_ to it. However, that myfile_ may change. How do... (1 Reply)
Discussion started by: guessingo
1 Replies
9. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
I'm trying to use a directory path to enter a new directory and sort the files there. I'm using the language C with a system call in Unix to sort the files from smallest to largest.
2. Relevant commands, code, scripts, algorithms:... (1 Reply)
Discussion started by: TedFTW
1 Replies
10. Shell Programming and Scripting
Hi All,
I am working on a huge pile of data. Its about a service initiating a call and and finishing it.
The columns that I have is:
Date Time URL Call Type ServiceName
5/11/2015 15:00:00 http-/0.0.0.0:8091-9 going to... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies
IGAWK(1) Utility Commands IGAWK(1)
NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO
gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)