01-30-2008
loop through the directory for files and sort by date and process the first file
hello
i have a requirement where i have a direcotry in which i get files in the format
STOCKS.20080114.dat
STOCKS.20080115.dat
STOCKS.20080117.dat
STOCKS.20080118.dat
i need to loop through the directory and sort by create date descending order and i need to process the first file.
can any body throw some light on it.
appreciate your help
nag
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to loop through files in a directory but omit the file with the latest date in my list of files. How would I accomplish this?
Thanks (2 Replies)
Discussion started by: stringzz
2 Replies
2. Linux
Hi All,
Sorry to throw this frequent question but I lost my notes on it.
How do you list the files by date? I'm on red hat.
Thanks in advance,
itik (1 Reply)
Discussion started by: itik
1 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
i'm new here in this forum. I really like the helpful answers in this forum.
Here a short question.
For a script i have to sort files by date and exclude the files of the actual date.
Sorting the files by date and preparing the output for awk is done by this line:
ls -l... (3 Replies)
Discussion started by: carlosdivega
3 Replies
4. Shell Programming and Scripting
hi there,
I have a directory which contents I can parse dynamically. I end up with a file list. I then want to display those files sorted by date, oldest files first. I have very very little PERL experience...Would anyone know how to do that ? Thanks in advance. (8 Replies)
Discussion started by: alexf
8 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I'm having a problem with some basic piping issues...
I have been able to get in a directory and ls | gsed in order to list every N file for instance:
ls | gsed -n '2~5p'
The thing is I want to be able to copy the output files to a new directory. Basically directory /all has a... (4 Replies)
Discussion started by: dgoss
4 Replies
6. Shell Programming and Scripting
this is what i have to find the files modified within the past 24 hours
find . -mtime -1 -type f -print0 | xargs -0 tar rvf "$archive.tar"
however i need to save/name this archive as the current date (MM-DD,YYYY.tar.gz)
how do i doo this (1 Reply)
Discussion started by: bugenhagen_
1 Replies
7. Shell Programming and Scripting
Hi Experts,
I have a filelist collected from another server , now want to sort the output using date/time stamp filed.
- Filed 6, 7,8 are showing the date/time/stamp.
Here is the input:
#----------------------------------------------------------------------
-rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies
8. Shell Programming and Scripting
Hi all,
i have a folder, with tons of files containing as following,
on /my/folder/jobs/
some_name_2016-01-17-22-38-58_some name_0_0.zip.done
some_name_2016-01-17-22-40-30_some name_0_0.zip.done
some_name_2016-01-17-22-48-50_some name_0_0.zip.done
and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies
9. Shell Programming and Scripting
Hello, how in bash i can get directory loop and order by creation date?
THX! :)
#!/bin/bash
for folder in /home/test/*
do
if ; then
echo $folder;
fi (12 Replies)
Discussion started by: ZerO13
12 Replies
10. UNIX for Beginners Questions & Answers
Hi all, (5 Replies)
Discussion started by: KMusunuru
5 Replies
LEARN ABOUT LINUX
unknown
UNKNOWN(1) General Commands Manual UNKNOWN(1)
NAME
unknown - identify possible genotypes for unknowns
SYNOPSIS
A program to rapidly identify which genotypes are possible for individuals typed as unknowns in the input pedigree.
unknown [ -cl ]
DESCRIPTION
unknown infers possible genotypes and mating combinations for parents with unknown genotypes for ilink(1), mlink(1) and linkmap(1).
OPTIONS
-c Use conditional allele frequencies.
-l Choose a good set of loop breakers automatically.
RETURN VALUE
0 Successful completion
ERRORS
10 File not found
255 Failure
EXAMPLES
Normally, unknown(1) is run immediately prior to its sister programs, ilink(1), mlink(1) and linkmap(1), like this:
unknown
mlink
FILES
unknown(1) reads the two files pedfile.dat and datafile.dat as its own input and produces various temporary files that are used as input to
the next program. These temporary files are ipedfile.dat, upedfile.dat, speedfile.dat and newspeedfile.dat.
NOTES
unknown(1) is part of the FASTLINK package, which is a re-implementation of the LINKAGE suite of computer tools that help investigate
genetic linkage as first proposed G.M. Lathrop, J.M. Lalouel, C. Julier, and J. Ott.
AUTHORS
Dylan Cooper, Alejandro Schaffer, and Tony Schurtz based on work originally by Jurg Ott, Ph.D, et. al.
This manual page was written by Elizabeth Barham <lizzy@soggytrousers.net> for the Debian GNU/Linux system (but may be used by others).
WORD-WIDE-WEB
http://www.ncbi.nlm.nih.gov/CBBResearch/Schaffer/fastlink.html
SEE ALSO
ilink(1), linkmap(1), lodscore(1), mlink(1).
April 15, 2003 UNKNOWN(1)