I have 3 variables , $file =abc_2011_11_01.txt (current day file), $back = Yes and $forward = No
I need to search for 3 days back files / 3 days forward files if my current file is not present
logic is,
I need to download the current day file.
If it is missing, i need to look out for currentday -1 file. (abc_2011_10_31.txt )
If that is missint, i need to check for currentday -2 file (abc_2011_10_31.txt )
If $forward is Yes , then I need to look out for currentday +1 file (abc_2011_11_02.txt )
If that is missing, I need to look out for currentday +2 file (abc_2011_11_03.txt )
IMP : The number of days file to check keeps changing. Eg: it may be 3, 4 or 9 etc...
Also, i need to check every file thrice with a sleep time of 100 seconds
How can i achieve this forward/backward check of files in perl?
Thanks in advance
yes. Previously I had to check for 3 days back file alone and not forward days check.
Actually I had to create the file name for current date since it wont be available already.
So I used ADD_delta_days function to create the filename as "abc_2011_11_02.txt" and kept the 3 days back files in an array so that i could check one by one.
Now that i need to do both look back and look forward after creating the current day file, am looking out for option other than add_delta_days.
Can you please let me know if its possible
yes i can post it. but sorry I dont find how to use code tags. Can you please show me the same
---------- Post updated at 02:26 AM ---------- Previous update was at 02:13 AM ----------
In the above case, the filename is constant pattern - abc_yyyymmdd.
But the one for which am doing, the filename can be any pattern which is not known
Eg: abc_yyyy_mm_dd, abc_YYMMD, abc_mm_dd
---------- Post updated at 03:30 AM ---------- Previous update was at 02:26 AM ----------
Also, Since the file name can be of any format, looking back/forward for files is a constraint when using Add_Delta_days
Can you please suggest alternate way to achieve this
Hello my friends,
I've come across the weirdest of glitches.
I'm running a simple weather monitor (just temperature) on a Raspbeery Pi 3B (Raspbian Linux 4.14.98-v7+). It has a 3G modem that sends out simple packets to my server at home.
On june 5th I lost remote access to the device.... (1 Reply)
Please help me n days to a date string in PERL. Date is of the format YYYYMMDD
---------- Post updated at 08:56 AM ---------- Previous update was at 08:54 AM ----------
Add n days (2 Replies)
Hi I have the following issue.
the headeer in the file contains as follows
IMAHDR tsmdsl01 EMBS_DAT 20120911 20120911
233656S000000000000000 001
So the fifth field in the header is a string that represents the file arrival date.(20120911) yyyyMMDD
I just need to compare... (1 Reply)
i need help! can someone help me please?
i try to calculate date under unix (ksh)...AIX operating system.
I have to find the date 200 days from today's date.
then the script should loop 200 times and display on command line every day's date until the current date.
example:
todays date:... (4 Replies)
i need help! can someone help me please?
i try to calculate date under unix (ksh)...AIX operating system.
I have to find the date 200 days from today's date.
then the script should loop 200 times and display on command line every day's date until the current date.
example:
todays date:... (1 Reply)
back in the good old 7.07 ghostscript days...
we had Great results converting pdf to ps output, from the following command:
cat $stuff | /usr/local/bin/gs -sDEVICE=ljet4 -q -dNOPAUSE -r200 -sPAPERSIZE=letter -dPDFFitPage -dBATCH -sOutputFile=- - 2> /dev/null | /usr/bin/lp -d $printer
... (3 Replies)
Hi,
Could you please let me know the command to change my date /time beyond few days back. Currently when i am trying the below commands able to go beyond one day at max.
-->date
-->Mon Sep 29 19:31:58 EST 2008
-->export TZ=TMP40:00:00 (Changing the date beyond 40 hours)
-->Sun Sep 28... (4 Replies)
I have two perl functions defined, both run a set of shell commands on some somplied data and return hashs of the resulting parsed output from these shell commands.
One works, one doesn't and I can't seem to see why. It's driving me insane :mad:
The working one:
sub getcellstatus {
... (8 Replies)
My input text has the following pattens:
func_a(3,
4,
5);
I want to replace it with this:
func_b(3,
4,
5,
6);
I'm trying the following expression, but it does not work:
perl -p -e "s/func_a\((.*)?\);/func_b(\1,\n6)/s" <... (8 Replies)