[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

need script to copy files in order

Posted on 2002-03-25
2
Medium Priority
?
212 Views
Last Modified: 2010-04-21
I have many files in a directory that are named as follows

QDV_200203191143190276.txt
QDV_200203191143190307.txt
QDV_200203191143190313.txt

Basically having the naming convention

QDV_YYYYMMDDHHMISSmmmm.txt

I need to copy these files one by one to another directory, where they will be read in by another program.  The program reading them in, polls at 1 second intervals, so if I could copy them in at 1.5 or 2 second intervals (preferrably 1.5) to the new directory, that would be great.

Just use directory1/directory2 naming conventions...I can change it to what I need it to be.

Thanks

mboss
0
Comment
Question by:mboss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 4

Expert Comment

by:newmang
ID: 6895368
What about something like the following

for FILENAME in `ls QD*.txt`
  do
     cp -f dir1/$FILENAME dir2/$FILENAME
     sleep 2
  done
exit

If you want them read in name order then the first line would read

for FILENAME in `ls QD*.txt | sort`

Note the tick marks are backticks....

Cheers - Gavin
0
 
LVL 4

Accepted Solution

by:
newmang earned 1200 total points
ID: 6895373
What about something like the following

for FILENAME in `ls QD*.txt`
  do
     cp -f dir1/$FILENAME dir2/$FILENAME
     sleep 2
  done
exit

If you want them read in name order then the first line would read

for FILENAME in `ls QD*.txt | sort`

Note the tick marks are backticks....

Cheers - Gavin
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question