11-06-2008
sorting
Quote:
Originally Posted by
demwz
Hello,
You need to convert the date string to epoch time (seconds since 1970). Therfore you first have to format the string to meet the requirements of your converter. On Linux you could use "date -d" (
date MAN Page) but perl or awk are much more flexible. I dont have the time to provide a complete script, sorry.
please provide the script to sort files as requested
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once... (2 Replies)
Discussion started by: rebel64
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
the command "ls -l" gives the list of files of a directory with details such as date and size.
Is there a way to restrict this list to see only files created on a given date? Suppose I want to list only the files created today, what is the command to type?
Thanks (3 Replies)
Discussion started by: vanagreg
3 Replies
3. UNIX for Advanced & Expert Users
Hi,
I was very surprised to not be able to find an answer to this question despite my best efforts in Google and elsewhere. Maybe it's a good thing as it forced me to finally become a member in this great forum that i use frequently.
Ok my question:
I want to be able to sort files inside a... (3 Replies)
Discussion started by: stavros
3 Replies
4. Shell Programming and Scripting
Hi,
I have the following file, I need to sort it based on a column and write to different output files based on this column
request_guid iso_country_cd address_data response_time
32895901-d17f-414c-ac93-3e7e0f5ec240 AND BaseName:CATALUNYA; HouseNumber:1; ISOCountryCode:AND;... (1 Reply)
Discussion started by: ramky79
1 Replies
5. Shell Programming and Scripting
hello,
I have a file as follows:
F0100010 A C F0100040 A G BTA-28763-no-rs 77.2692
F0100020 A G F0100030 A T BTA-29334-no-rs 11.4989
F0100030 A T F0100020 A G BTA-29515-no-rs 127.006
F0100040 A G F0100010 A C BTA-29644-no-rs 7.29827
F0100050 A... (9 Replies)
Discussion started by: Homa
9 Replies
6. Shell Programming and Scripting
I am wanting to search a directory tree and return files that are older than a specified datetime. So far straight forward with find, now I want to sort in date order and format the output.
So far I have this, but is not working and there is a problem with "." in the file and/or path names.
... (2 Replies)
Discussion started by: larry2311
2 Replies
7. UNIX for Dummies Questions & Answers
Hi all, looking for some help here. I'm what you'd call a dirty programmer. my shell scripts might be ugly, but they (usually) function...
Say I have a single column text file with a list of dates (yyyymmdd) that represent the elevation of a point on that date (I work with land subsidence, so... (2 Replies)
Discussion started by: jbrandt1979
2 Replies
8. Shell Programming and Scripting
Hi All,
I need to find all files other than first two files dates & last file date for month and month/year wise list.
lets say there are following files in directory
Mar 19 2012 c.txt
Mar 19 2012 cc.txt
Mar 21 2012 d.txt
Mar 22 2012 f.txt
Mar 24 2012 h.txt
Mar 25 2012 w.txt
Feb 12... (2 Replies)
Discussion started by: Makarand Dodmis
2 Replies
9. UNIX for Dummies Questions & Answers
HI,
i have to do some file validations on which i am receving daily.could any one please let me know how we can able to do validations on below scenarios
1) On Date column Ex If i am receving date in format of YYYYMMDD---- 20141118 --- here i have to check the date value 20141142 if the... (7 Replies)
Discussion started by: bhaskar v
7 Replies
10. Shell Programming and Scripting
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
HLS(1) General Commands Manual HLS(1)
NAME
hls - list files in an HFS directory
SYNOPSIS
hls [options] [hfs-path ...]
DESCRIPTION
hls lists files and directories contained in an HFS volume. If one or more arguments are given, each specified file or directory is shown;
otherwise, the contents of the current working directory are shown.
OPTIONS
-1 Output is formatted such that each entry appears on a single line. This is the default when stdout is not a terminal.
-a All files and directories are shown, including "invisible" files, as would be perceived by the Macintosh Finder. Normally invisible
files are omitted from directory listings.
-b Special characters are displayed in an escaped backslash notation. Normally special or non-printable characters in filenames are
replaced by a question mark (?).
-c Sort and display entries by their creation date, rather than their modification date.
-d List directory entries themselves rather than their contents. Normally the contents are shown for named directories on the command-
line.
-f Do not sort directory contents; list them in the order they appear in the directory. This option effectively enables -a and -U and
disables -l, -s, and -t.
-i Show the catalog IDs for each entry. Every file and directory on an HFS volume has a unique catalog ID.
-l Display entries in long format. This format shows the entry type ("d" for directory or "f" for file), flags ("i" for invisible),
file type and creator (four-character strings for files only), size (number of directory sub-contents or file resource and data
bytes, respectively), date of last modification (or creation, with -c flag), and pathname. Macintosh "locked" files are indicated by
"F" in place of "f".
-m Display entries in a continuous format separated by commas.
-q Replace special and non-printable characters in displayed filenames with question marks (?). This is the default when stdout is con-
nected to a terminal.
-r Sort entries in reverse order before displaying.
-s Show the file size for each entry in 1K block units. The size includes blocks used for both data and resource forks.
-t Sort and display entries by time. Normally files will be sorted by name. This option uses the last modification date to sort unless
-c is also specified.
-x Display entries in column format like -C, but sorted horizontally into rows rather than columns.
-w width
Format output lines suitable for display in the given width. Normally the width will be determined from your terminal, from the
environment variable COLUMNS, or from a default value of 80.
-C Display entries in column format with entries sorted vertically. This is the default output format when stdout is connected to a
terminal.
-F Cause certain output filenames to be followed by a single-character flag indicating the nature of the entry; directories are fol-
lowed by a colon (:) and executable Macintosh applications are followed by an asterisk (*).
-N Cause all filenames to be output verbatim without any escaping or question-mark substitution.
-Q Cause all filenames to be enclosed within double-quotes (") and special/non-printable characters to be properly escaped.
-R For each directory that is encountered in a listing, recursively descend into and display its contents.
-S Sort and display entries by size. For files, the combined resource and data lengths are used to compute a file's size.
-U Do not sort directory contents; list them in the order they appear in the directory. On HFS volumes, this is usually an alphabetical
case-insensitive ordering, although there are some idiosyncrasies to the Macintosh implementation of ordering. This option does not
affect -a, -l, or -s.
SEE ALSO
hfsutils(1), hcd(1), hpwd(1), hdir(1), hcopy(1)
FILES
$HOME/.hcwd
AUTHOR
Robert Leslie <rob@mars.org>
HFSUTILS
14-Jan-1997 HLS(1)