Sponsored Content
Top Forums Shell Programming and Scripting Concatenate all the files in folder on timestamps Post 302131290 by srikanthgr1 on Friday 10th of August 2007 02:59:13 AM
Old 08-10-2007
Hi BlowTorch,

Thanks for you Help.

The File order is like this .
The Oldest File content needs to be concatenated at the begining and the latest ones at end.
It will be in the descending order of the timestamp.

I found out another method like First I will remove the Tags <ACKNOWLEDGEMENTS> and </ACKNOWLEDGEMENTS> in all the files and later concatenate them.

Concatenating the files are fine but the problem is How to use the sort command


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.


i.e. If theese are the files

Ack_to_MDS_20070809141159.xml
Ack_to_MDS_20070809141157.xml
Ack_to_MDS_20070809141155.xml
Ack_to_MDS_20070809141151.xml
Ack_to_MDS_20070809141149.xml
Ack_to_MDS_20070809141148.xml


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 I will Append the Tags <ACKNOWLEDGEMENTS> and </ACKNOWLEDGEMENTS> to the first line and last line of the concatenated file.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies

2. Shell Programming and Scripting

Getting all the .gz files between Two Date/TimeStamps

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)
Discussion started by: openspark
3 Replies

3. UNIX for Dummies Questions & Answers

recursively concatenate files in subdirectories with same folder name

I'm trying to concatenate files in subdirectories with the same folder name. Say concatenate all the files in the 'current' subdirectories in 'Literature' parent directory. Literature/USA/current/ Literature/Europe/current/ Can anyone help with it? Thanks a lot! (2 Replies)
Discussion started by: joyce007
2 Replies

4. UNIX for Advanced & Expert Users

Recursively concatenate files in subdirectories with the same folder name

I'm trying to concatenate files in subdirectories with the same folder name. Say concatenate all the files in the 'current' subdirectories in 'Literature' parent directory. Literature/USA/current/ Literature/Europe/current/ Can anyone help with it? Thanks a lot! (2 Replies)
Discussion started by: joyce007
2 Replies

5. Shell Programming and Scripting

Bash script to copy timestamps of multiple files

Hi, I have a bunch of media files in a directory that have been converted (from MTS to MOV format), so my directory contains something like this: clip1.mts clip1.mov clip2.mts clip2.mov The problem is that the .mov files that have been created have the timestamps of the conversion task,... (2 Replies)
Discussion started by: Krakus
2 Replies

6. Shell Programming and Scripting

Sorting the files on their timestamps

Hi, The file names are like XXXX_20111101.gz for 01 November 2011, etc. There might be several files for 01 November 2011 and I can find them using find DIR -name *_20111101.gz -exec ls -lt {} \; But I want to sort the listing returned by the above command on the timestamps of the files... (6 Replies)
Discussion started by: sagarparadkar
6 Replies

7. Shell Programming and Scripting

Issues with comparing 2 files timestamps

Hi, Im trying to write a script to first check a directory and if the filename has "ACK" in it do nothing and exit but if it has "ORD" in the filename then compare it with a dummy file created 2 minutes previous and see which one is newer Im getting a few errors which im unsure how to rectofy... (5 Replies)
Discussion started by: 02JayJay02
5 Replies

8. Shell Programming and Scripting

Find matching timestamps in two files.

OK. if the first file is : 3184 2014-07-28 04:15 global.Remote-Access 10.111.8.25 81.245.6.25 tcp 3268 3035 2014-07-28 04:16 global.Remote-Access 10.111.8.12 81.245.6.25 tcp 3268If the second file is: 1 Jul 28 04:12 2014-07-28 id967254(BGC-TLW-Cert) Tunneling: User with IP... (8 Replies)
Discussion started by: fxsme
8 Replies

9. 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

10. 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
WWW::OpenSearch::Description(3pm)			User Contributed Perl Documentation			 WWW::OpenSearch::Description(3pm)

NAME
WWW::OpenSearch::Description - Encapsulate an OpenSearch Description provided by an A9 OpenSearch compatible engine SYNOPSIS
use WWW::OpenSearch; my $url = "http://bulkfeeds.net/opensearch.xml"; my $engine = WWW::OpenSearch->new($url); my $description = $engine->description; my $format = $description->Format; # or $description->format my $longname = $description->LongName; # or $description->longname DESCRIPTION
WWW::OpenSearch::Description is a module designed to encapsulate an OpenSearch Description provided by an A9 OpenSearch compatible engine. See http://opensearch.a9.com/spec/1.1/description/ for details. CONSTRUCTOR
new( [ $xml ] ) Constructs a new instance of WWW::OpenSearch::Description. If scalar parameter $xml is provided, data will be automatically loaded from it using load( $xml ). METHODS
load( $xml ) Loads description data by parsing provided argument using XML::LibXML. urls( ) Return all of the urls associated with this description in an array. get_best_url( ) Attempts to retrieve the best URL associated with this description, based on the following content types (from most preferred to least preferred): o application/atom+xml o application/rss+xml o text/xml get_url_by_type( $type ) Retrieves the first WWW::OpenSearch::URL associated with this description whose type is equal to $type. ACCESSORS
version( ) ns( ) AdultContent( ) Attribution( ) Contact( ) Description( ) Developer( ) Format( ) InputEncoding( ) Image( ) Language( ) LongName( ) OutputEncoding( ) Query( ) SampleSearch( ) ShortName( ) SyndicationRight( ) Tags( ) Url( ) AUTHOR
o Tatsuhiko Miyagawa <miyagawa@bulknews.net> o Brian Cassidy <bricas@cpan.org> COPYRIGHT AND LICENSE
Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-05-25 WWW::OpenSearch::Description(3pm)
All times are GMT -4. The time now is 01:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy