Pick files after specified Time from a folder in Perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pick files after specified Time from a folder in Perl
# 1  
Old 03-31-2012
Pick files after specified Time from a folder in Perl

Hi All
I am stuck in a problem and wants help
What i want to do is I have a directory(say name of that directory is outdir) In that directory(outdir) the files come after some gap of time by some processes.

What i want to do is i want to list all the files in that directory after the given time.

Eg. I want to list all the files in outdir which had come after time (2012-3-31 0-16:45) (yyyy/mm/dd hh-mm:ss) in PERL

Last edited by parthmittal2007; 03-31-2012 at 08:34 AM..
# 2  
Old 03-31-2012
Hi parthmittal2007,

Provide some of those files and expected output.
# 3  
Old 04-02-2012
As the dir name is outdir, The files already present in that
dir is b1, b2, b3
Suppose at time 2012-3-31 0-16:45 the files that come in dir is
is a1, a2 , a3 by some process going on.

Now suppose i want to list all the files which had come on and after the time
2012-3-31 0-16:45

Then the expected output will be

a1,a2,a3


---------- Post updated 04-02-12 at 04:20 AM ---------- Previous update was 04-01-12 at 11:56 PM ----------

If possible i can do in Unix also.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies

2. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

3. Shell Programming and Scripting

How to pick system time of the file placed on UNIX?

Hi ,I got one data file from external source and I have to load it in database through sql loader. I want to add 2 columns in database,one is file name and one is time of the file received on server. -rwxr-x--- 1 user user 238 Jun 03 16:32 90936264971326030616.ctr From above case,... (21 Replies)
Discussion started by: Ruchika
21 Replies

4. Shell Programming and Scripting

Needs perl script - pick right file name

Hi., I need in perl type ...where this is an example : assume a directory has 3 files namely: file1_1445566_201501022.txt file1_1445566_201502024.txt file1_1445566_201503009.txt where ,after second underscore, the number is in YYYYMMDD time-stamp format, I need perl script to pick up... (3 Replies)
Discussion started by: alnhk
3 Replies

5. Shell Programming and Scripting

Problem writing/wrapping files under folder using perl

I have a script which generates env setup xml file by reading path.It read the path and checks if there is any file/dir present recurseively. If a file is found under sub directory then it will read the file and the values from the file are passed to generate xml format. Problem is if i have a... (0 Replies)
Discussion started by: Optimus81
0 Replies

6. Shell Programming and Scripting

Perl script to parse all files in the folder

Hello Smart People! I have a perl script that will import xml data into an access db. I would like to modify it so it will automatcially parse through all xml files in the folder. I swa a post but couldnt get it working. her is what my scrip looks like, i only list the top if you need more... (3 Replies)
Discussion started by: cowboymaverick
3 Replies

7. Shell Programming and Scripting

How to find last updated date and time of a folder in Perl?

Hi All, I have a process which after some time continues move a files to some folder(say the name of the folder is logdir) What i am trying to do is as the files are coming to the logdir folder, I want the latest updated time and date of the folder in PERL. (1 Reply)
Discussion started by: parthmittal2007
1 Replies

8. UNIX for Dummies Questions & Answers

Script to pick the files from source folder

Hi, I wrote a script to pick files based on some logic. when I execute my script, I get the below message ( I bolded the lines in the script where this error message shows up), it says that files are not available and it is a valid scenario if the files are not available and I don't know how... (9 Replies)
Discussion started by: Vijay81
9 Replies

9. Linux

rename files in a folder with date&time stamp

Hi, I want to rename all the files (more than 100 files) in a fodler to another folder with date&time stamp. foe eg, file1.dat file2.dat file3.dat .. to be renamed as file1100629_16_30_15.txt (yy-mon-dd_hh_mi_ss) file1100629_16_30_16.txt .. so on (2 Replies)
Discussion started by: feroz
2 Replies

10. Shell Programming and Scripting

perl merge two files by the time sequence

Hi Guys, i have two files: fileA: 20090611 00:00:11 20090611 00:00:11 20090611 00:00:24 20090611 00:01:10 20090611 07:13:00 fileB: 20090611 00:00:01 20090611 00:00:12 20090611 00:00:24 20090611 00:01:12 20090611 09:13:00 want to make two files into a single file, but follow the... (14 Replies)
Discussion started by: jimmy_y
14 Replies
Login or Register to Ask a Question