Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support How to append date and time stamp before the two extensions? Post 302840625 by Little on Tuesday 6th of August 2013 05:22:05 AM
Old 08-06-2013
How to append date and time stamp before the two extensions?

hi,

i have some file names. my file names are as follows:
Code:
c_abc_new.txt.xls
c_def.txt.xls

i want to append date time stamp in the below manner.
Code:
c_abc_new_YYYYMMDD_HH24MISS.txt.xls
c_def_YYYYMMDD_HH24MISS.txt.xls

check the two input file names, they differ in naming. the 1st file name has 2 underscores but the 2nd has only 1.
can anyone tell me how to do this??
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File date and time stamp

I have to capture the creation date and time stamp for a file. The ls command doesn't list all the required information. I need year, month, day, hour, minute and second. Any ideas... (1 Reply)
Discussion started by: Xenon
1 Replies

2. Shell Programming and Scripting

Date Time Stamp

I'm trying to write a script that checks the DTS of a file the compares it to the current time. If greater that 60 mins has gone by and the file has not been written to alert. So far I have the time pulled from the file but I dont know how to compare the times against a 60 min difference. ... (2 Replies)
Discussion started by: jarich
2 Replies

3. Shell Programming and Scripting

Insert Time and Date Stamp

I have a directory with following files in it ABC.000.DAT ABC.001.DAT ABC.002.DAT ABC.003.DAT I want to insert time and date stamp in file names like ABC.000.YYYYMMDDHHMM.DAT I able to insert the time and date stamp at the end of filename Kindly help (1 Reply)
Discussion started by: aajmani
1 Replies

4. UNIX for Dummies Questions & Answers

Date/Time Stamp

Hi All, Wondering if there is have a date added at the end of a test string. I have a hypothetical text file day one: John Paul George When the file day one is output, I'd like it to read something like this: John 101406 Paul 101406 George 101406 Day two, when the same text file... (0 Replies)
Discussion started by: JimmyFlip
0 Replies

5. UNIX for Advanced & Expert Users

rsync - date/time stamp

Hi, We are using RSYNC for syncing remote directories and working great. Our requirement is to have the destination files with date/time stamp of when they're copied on to the destination server, NOT the date/time stamps of source files/directories. As RSYNC, by default, preserving the same... (4 Replies)
Discussion started by: prvnrk
4 Replies

6. Shell Programming and Scripting

append date time stamp via ftp script

I have searched several thread and not found my solution, so I am posting a new qustion. I have a very simple script on an AIX server that FTPs 2 files to a MS FTP server. These 2 files are created on the AIX server every hour, with a static name. I need to FTP the files to the MS server, but... (1 Reply)
Discussion started by: sknisely
1 Replies

7. UNIX for Dummies Questions & Answers

ls -ltr for a future date/time stamp file

Hi When i do ls -ltr <file1> then it shows me the date and time of the file if - for whatever reason file has future date/time stamp then ls -ltr is not showing the time, it just shows only date part ... even if time is ahead by 2 hr than current time. suppose a file was copied from INDIA... (3 Replies)
Discussion started by: reldb
3 Replies

8. Shell Programming and Scripting

Set date and time stamp of one file to another

Hi I use "touch -t xxxxxxxx" command to set date/time stamp of a file. My requirement is to read the date/time stamp of a file and apply it to another file. Is there anyway to do it simple instead of manually taking date/stamp of first file? TIA Prvn (2 Replies)
Discussion started by: prvnrk
2 Replies

9. Shell Programming and Scripting

Files with date and time stamp

Hi Folks, Need a clarification on files with date and time stamp. Here is my requirement. There is a file created everyday with the following format "file.txt.YYYYMMDDHHMMSS". Now i need to check for this file and if it is available then i need to do some task to the file. I tried... (6 Replies)
Discussion started by: jayadanabalan
6 Replies

10. Shell Programming and Scripting

Perl:Script to append date and time stamp

Help with Perl script : I have a web.xml file with a line <display-name>some_text_here</display-name> Need to append the current date and time stamp to the string and save the XML file Something like <display-name>some_text_here._01_23_2014_03_56_33</display-name> -->Finally want... (5 Replies)
Discussion started by: gaurav99
5 Replies
EXIMSTATS(8)							       EXIM4							      EXIMSTATS(8)

NAME
eximstats - generates statistics from Exim mainlog or syslog files. SYNOPSIS
eximstats [Output] [Options] mainlog1 mainlog2 ... eximstats -merge [Options] report.1.txt report.2.txt ... > weekly_report.txt Output: -txt Output the results in plain text to STDOUT. -txt=filename Output the results in plain text. Filename '-' for STDOUT is accepted. -html Output the results in HTML to STDOUT. -html=filename Output the results in HTML. Filename '-' for STDOUT is accepted. -xls Output the results in Excel compatible Format to STDOUT. Requires the Spreadsheet::WriteExcel CPAN module. -xls=filename Output the results in Excel compatible format. Filename '-' for STDOUT is accepted. Options: -hnumber histogram divisions per hour. The default is 1, and 0 suppresses histograms. Valid values are: 0, 1, 2, 3, 5, 10, 15, 20, 30 or 60. -ne Don't display error information. -nr Don't display relaying information. -nr/pattern/ Don't display relaying information that matches. -nt Don't display transport information. -nt/pattern/ Don't display transport information that matches -qlist List of times for queuing information single 0 item suppresses. -tnumber Display top <number> sources/destinations default is 50, 0 suppresses top listing. -tnl Omit local sources/destinations in top listing. -t_remote_users Include remote users in the top source/destination listings. -include_original_destination Include the original destination email addresses rather than just using the final ones. Useful for finding out which of your mailing lists are receiving mail. -show_dtlist Show the delivery times (DT)for all the messages. Exim must have been configured to use the +deliver_time logging option for this option to work. list is an optional list of times. Eg -show_dt1,2,4,8 will show the number of messages with delivery times under 1 second, 2 seconds, 4 seconds, 8 seconds, and over 8 seconds. -show_rtlist Show the receipt times for all the messages. The receipt time is defined as the Completed hh:mm:ss - queue_time_overall - the Receipt hh:mm:ss. These figures will be skewed by pipelined messages so might not be that useful. Exim must have been configured to use the +queue_time_overall logging option for this option to work. list is an optional list of times. Eg -show_rt1,2,4,8 will show the number of messages with receipt times under 1 second, 2 seconds, 4 seconds, 8 seconds, and over 8 seconds. -byhost Show results by sending host. This may be combined with -bydomain and/or -byemail and/or -byedomain. If none of these options are specified, then -byhost is assumed as a default. -bydomain Show results by sending domain. May be combined with -byhost and/or -byemail and/or -byedomain. -byemail Show results by sender's email address. May be combined with -byhost and/or -bydomain and/or -byedomain. -byemaildomain or -byedomain Show results by sender's email domain. May be combined with -byhost and/or -bydomain and/or -byemail. -pattern Description /Pattern/ Look for the specified pattern and count the number of lines in which it appears. This option can be specified multiple times. Eg: -pattern 'Refused connections' '/refused connection/' -merge This option allows eximstats to merge old eximstat reports together. Eg: eximstats mainlog.sun > report.sun.txt eximstats mainlog.mon > report.mon.txt eximstats mainlog.tue > report.tue.txt eximstats mainlog.wed > report.web.txt eximstats mainlog.thu > report.thu.txt eximstats mainlog.fri > report.fri.txt eximstats mainlog.sat > report.sat.txt eximstats -merge report.*.txt > weekly_report.txt eximstats -merge -html report.*.txt > weekly_report.html o You can merge text or html reports and output the results as text or html. o You can use all the normal eximstat output options, but only data included in the original reports can be shown! o When merging reports, some loss of accuracy may occur in the top n lists. This will be towards the ends of the lists. o The order of items in the top n lists may vary when the data volumes round to the same value. -charts Create graphical charts to be displayed in HTML output. Only valid in combination with -html. This requires the following modules which can be obtained from http://www.cpan.org/modules/01modules.index.html GD GDTextUtil GDGraph To install these, download and unpack them, then use the normal perl installation procedure: perl Makefile.PL make make test make install On Debian GNU/Linux you can use "apt-get install libgd-perl libgd-text-perl libgd-graph-perl" instead. -chartdirI <dir> Create the charts in the directory <dir> -chartrelI <dir> Specify the relative directory for the "img src=" tags from where to include the charts -emptyok Specify that it's OK to not find any valid log lines. Without this we will output an error message if we don't find any. -d Debug flag. This outputs the eval()'d parser onto STDOUT which makes it easier to trap errors in the eval section. Remember to add 1 to the line numbers to allow for the title! DESCRIPTION
Eximstats parses exim mainlog and syslog files to output a statistical analysis of the messages processed. By default, a text analysis is generated, but you can request other output formats using flags. See the help (-help) to learn about how to create charts from the tables. AUTHOR
There is a web site at http://www.exim.org TO DO
This program does not perfectly handle messages whose received and delivered log lines are in different files, which can happen when you have multiple mail servers and a message cannot be immediately delivered. Fixing this could be tricky... Merging of xls files is not (yet) possible. Be free to implement :) perl v5.14.2 2014-07-24 EXIMSTATS(8)
All times are GMT -4. The time now is 04:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy