Re: Sort files by filename
- From: "Mark Haney" <mhaney@xxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 15:45:24 -0400
Mikkel L. Ellertson wrote:
Mark Haney wrote:With apologies to the 2 Les', the situation isn't like that and IIf your data has a fixed file length, cut can separate out the
apologize if I've not been clear. The application that I'm working with
is running on a server that simply relays the data to all our
customers, it doesn't store a copy of the files and then feed them. The
NWS weather data requires as close to real-time performance and the
'series of tubes' allows. That said, I'm running another server that
runs the same application but is designed to pull the data feed and then
store the files locally. I /can/ store the files on the primary server,
and I have, but this is a production server that feeds 13MB/hr for each
of the 60 or so radar sites it handles 24/7 so I don't like asking it to
do more than it does.
So, in essence I'm stuck with these files being dumped on a server via a
proprietary method. So I need to sort the files and check for missing
ones on the filesystem.
The early suggestions were great and I'm trying each one and tweaking to
see if I can make them work with what I have. But any additional bash
tips would be helpful as I am pressed for an answer to this issue.
specific bytes you want to sort on. If not, then if there is a
specific separator between parts of the name, bot cut and sort can
use that to grab the part you want to sort on. What I suspect would
work well on for you is to feed the output of ls though sort, and
then use a for loop with counter to compare the part you are
interested in to check for missing numbers. By doing a compare of
the first part of the file name, you can reset the counter for each
series of files. Or you can have ls only produce one set of files.
count=xx
for i in $(ls <something>* | sort) ; do
file_num=$(cut --delimiter=_ -f1 $i)
while [ $count -lt $file_num ] ; do
echo Missing file number $count
count++
done
done
This is a very rough script to give you an idea. I can see problems
where you get a file name that is in the wrong format, that causes
the while loop to go on forever. But if I didn't make too many
syntax errors, it should give you a starting point.
Mikkel
This is great. I think now I have enough pieces to make something work. I appreciate all the help.
--
Recedite, plebes! Gero rem imperialem!
Mark Haney
Sr. Systems Administrator
ERC Broadband
(828) 350-2415
Call (866) ERC-7110 for after hours support
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
- Follow-Ups:
- Re: Sort files by filename
- From: Les Mikesell
- Re: Sort files by filename
- References:
- Sort files by filename
- From: Mark Haney
- RE: Sort files by filename
- From: Miner, Jonathan W (CSC) (US SSA)
- RE: Sort files by filename
- From: Rodolfo Alcazar Portillo
- Re: Sort files by filename
- From: Mark Haney
- Re: Sort files by filename
- From: Kam Leo
- Re: Sort files by filename
- From: Mark Haney
- Re: Sort files by filename
- From: Les Mikesell
- Re: Sort files by filename
- From: Mark Haney
- Re: Sort files by filename
- From: Mikkel L. Ellertson
- Sort files by filename
- Prev by Date: Re: Sort files by filename
- Next by Date: Re: Back Again
- Previous by thread: Re: Sort files by filename
- Next by thread: Re: Sort files by filename
- Index(es):
Relevant Pages
- Re: Sort files by filename
... Les Mikesell wrote: ... The application that I'm working with is running on
a server that simply relays the data to all our customers, it doesn't store a copy of the
files and then feed them. ... I /can/ store the files on the primary server, and I have, but this
is a production server that feeds 13MB/hr for each of the 60 or so radar sites it handles 24/7
so I don't like asking it to do more than it does. ... (Fedora) - Re: Sort files by filename
... With apologies to the 2 Les', the situation isn't like that and I ... is running
on a server that simply relays the data to all our ... but this is a production server
that feeds 13MB/hr for each ... So I need to sort the files and check for missing
... (Fedora) - Re: OE6 says no new messages, but there ARE
... Then retry the View, Sort by. ... The server name is on the servers tab
in the box labelled: ... It's like they download into a ... >> Troubleshooting
Logging for Mail and verify that you see RETR requests. ... (microsoft.public.windows.inetexplorer.ie6_outlookexpress) - Re: [Full-disclosure] phishing sites examples "source code"
... On 2/19/07, Juergen Fiedler wrote: ... code for the form action because it is
done in some sort of server ... side scripting that can't readily be ...
Can't readily be viewed BUT that part is sort of not-the-problem. ... (Full-Disclosure) - Re: "Depreciated" Parameters In SPFILE
... however, in case you switch to shared server mode (or, remembering ... and Oracle
is able to adjust the value of the parameter ... SORT_AREA_SIZE to 20MB, resulting in the
elimination of the sort to ... dedicated server environment. ... (comp.databases.oracle.server)