Now, I will have an input parameter coming in as 'Directory path' (path to Y) and type (can be PP, QQ or RR. If type is NULL, means I need to process all the 3 types)
Assuming we get type as PP
Now I need to pick up files of this type. We can see there are 5 files matching this string.
Now, I need to check the date and time stamp as available in the file names (and not the unix system date timestamp), compare it, and pick up the file with the lowest date timestamp in its name, first - and process it.
As you see I have 2 files with same timestamp here - PP_100000_28062006_122731_746.dat and PP_100000_28062006_122731_745.dat. In this case I have to process it in ascending order of <organisationID>. ie, PP_100000_28062006_122731_745.dat first, followed by PP_100000_28062006_122731_746.dat
Once processed, I have to pick the next lowest date time stamp file for processing.
I will be archiving successfully processed files in another directory, and renaming failed files to say FAILED (suffix) so that it wont be picked up again.
Any sample code/ pointers/ suggestions would be of great help.
The files are of format Ack_to_MDS_YYYYMMDDHHMMSS.xml
The Content of the files are like this
Later I need to cat the files based on the timestamps present in the file format i.e Ack_to_MDS_YYYYMMDDHHMMSS.xml.
The Sort order is the oldest file contents needs to be at the top and the Latest file at the end.
Then The Sorted Order is
Ack_to_MDS_20070809141148
Ack_to_MDS_20070809141149
Ack_to_MDS_20070809141151
Ack_to_MDS_20070809141155
Ack_to_MDS_20070809141157
Ack_to_MDS_20070809141159
Later The concatenation order is also as the above .
Then Append the Tags <ACKNOWLEDGEMENTS> and </ACKNOWLEDGEMENTS> to the first line and last line of the concatenated file.
Hi All,
I need to find all files other than first two files dates & last file date for month and month/year wise list.
lets say there are following files in directory
Mar 19 2012 c.txt
Mar 19 2012 cc.txt
Mar 21 2012 d.txt
Mar 22 2012 f.txt
Mar 24 2012 h.txt
Mar 25 2012 w.txt
Feb 12... (2 Replies)
So given filenames of varying lengths, I was wondering how I would remove or modify appended timestamps of the current date DD-MM-YY.
So say:
test_DD-MM-YY.txt
coolbeans_DD-MM-YY.pdf
And what I expect the output to be:
test.txt
coolbeans.pdf
Thanks :) (2 Replies)
Hi,
I have a list of log files as follows:
name_date_0001_ID0.log
name_date_0001_ID2.log
name_date_0001_ID1.log
name_date_0002_ID2.log
name_date_0004_ID0.log
name_date_0005_ID0.log
name_date_0021_ID0.log
name_date_0025_ID0.log
.......................................... (4 Replies)
Hi all.
I am very new to linux scripting and i have a task i can only solve with a script.
I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders.
Scenario:
Folder Path:... (1 Reply)
Hi all.
I am very new to linux scripting and i have a task i can only solve with a script.
I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders.
Scenario:
Folder Path:... (1 Reply)
Hi, I am a newbie to shell programming and I need some help in sorting a list of files in ascending order of date in the filenames.
The file format is always : IGL01_AC_D_<YYYYMMDD>_N01_01
For example, in a directory MyDirectory I have the following files:
IGL01_AC_D_20110712_N01_01.dat... (11 Replies)
dear all,
i have .dat files named as:
34.dat
2.dat
16.dat
107.dat
i would like to sort them by their filenames as:
2.dat
16.dat
34.dat
107.dat
i have tried numerous combinations of sort and ls command (in vain) to obtain :
107.dat
16.dat
2.dat
34.dat (1 Reply)
Hi,
I am trying to write a script to ftp and get all the files between two date/time stamps from a archive directory. I have sent an attatchment of my archive directory. With the script I intend to get files for ex: between request.log.2008-08-22-03-53-49.gz &... (3 Replies)
Hi,
I have some question and need some guidance how to sort and match multiple files.
1. all the data in the files are numbers
e.g. 1234567
1584752
2563156
2. each sorted file have their own ouput. e.g. test.csv -> test_sorted.csv
3. Then, I need to match all... (4 Replies)