Sponsored Content
Top Forums Shell Programming and Scripting Appending unix timestamp to every line of a statistical file Post 302574251 by zaxxon on Thursday 17th of November 2011 02:16:01 AM
Old 11-17-2011
You could either cut and multiply it with seconds yourself to get it or use some neat perl function like localtime - perldoc.perl.org
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending data at the first and last line of a file

Hi, Am trying to write a shell script which will append a header and a footer to an existing file. Header will contain details like the current date while the footer will contain the no: of records listed in the file. I know we can use the CAT command, but i have no clue abt the syntax to... (4 Replies)
Discussion started by: brainstormer
4 Replies

2. UNIX for Dummies Questions & Answers

appending timestamp to a file

hi freinds, i need to append timestamp to a file name to make it unique... do we have any command in unix to do please help :confused: (2 Replies)
Discussion started by: madhu_aqua14
2 Replies

3. Shell Programming and Scripting

Appending the line number and a seperator to each line of a file ?

Hi, I am a newb as far as shell scripting and SED goes so bear with me on this one. I want to basically append to each line in a file a delimiter character and the line's line number e.g Change the file from :- aaaaaa bbbbbb cccccc to:- aaaaaa;1 bbbbbb;2 cccccc;3 I have worked... (4 Replies)
Discussion started by: pjcwhite
4 Replies

4. Shell Programming and Scripting

Appending a line in a file after a particular line

Hello, I have got a C file in which I would like to add an include statement of my own. There are already a few include statements and mine should come right after the last existing one (to be neat). With grep I can get the lines containing the word 'include' and I guess I should feed the... (7 Replies)
Discussion started by: maxvirrozeito
7 Replies

5. Shell Programming and Scripting

Appending a column in one file to the corresponding line in a second

It appears that this has been asked and answered in similar fashions previously, but I am still unsure how to approach this. I have two files containing user information: fileA ttim:/home/ttim:Tiny Tim:632 ppinto:/home/ppinto:Pam Pinto:633 fileB ttim:xkfgjkd*&#^jhdfh... (3 Replies)
Discussion started by: suzannef
3 Replies

6. Shell Programming and Scripting

appending data to last line of file

A friend contacted me recently with an interesting question. We got something worked out, but I'm curious what answers you all can come up with. Given a shell script (in bash) that processes a bunch of data and appends it to a file, how would you append the date, time, and a filename to the... (6 Replies)
Discussion started by: malcolmpdx
6 Replies

7. UNIX for Dummies Questions & Answers

Appending timestamp problem

Hi, I am trying to insert a timestamp after all the file names in a folder,after the timestamp is created in the filename the file size is becoming zero bytes. please tell me where I am doing it wrong. I have declared the variable in starting of my script. timestamp=`date... (1 Reply)
Discussion started by: shruthidwh
1 Replies

8. UNIX for Dummies Questions & Answers

Appending Date at the end ONLY in first line of file

Hi, My requirement is to append a date in format DDMMYYYYHHMISS at the end of first line of file which is HEADER. I am trying command sed -i '1s/.*/&<date_format>/' <file_name> Where <date_format>=`date +%m%d%Y%H%M%S` I am somehow misisng the right quotes ti get this added in above... (2 Replies)
Discussion started by: sanjaydubey2006
2 Replies

9. Shell Programming and Scripting

Appending timestamp to a file. Why do I need this space ?

Version Info $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.4 (Tikanga) $ $ echo $0 -ksh I was trying to append date to the file name. The following syntax has worked $ touch HELLO-`date '+%d-%b-%Y'`.txt $ ls -alrt HELL* -rw-r--r-- 1 rlapp oinstall 0 Feb 20... (2 Replies)
Discussion started by: John K
2 Replies

10. Shell Programming and Scripting

Bash - Appending to specific line in file

I'm working on a personal project, a multiplication quiz script for my kids. In it, the user's performance will be recorded and written to a file. After they've played it a little while, it will start to focus more on the ones that give them the most trouble-- that take a long time to answer or... (4 Replies)
Discussion started by: treesloth
4 Replies
Test::Most::Exception(3pm)				User Contributed Perl Documentation				Test::Most::Exception(3pm)

NAME
Test::Most::Exception - Internal exception class VERSION
Version 0.25 SYNOPSIS
This is the exception thrown by "die_on_fail" by "Test::Most". EXPORT
We export only one function: "throw_failure" This is the exception for "die_on_fail". AUTHOR
Curtis Poe, "<ovid at cpan.org>" BUGS
Please report any bugs or feature requests to "bug-test-extended at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Most <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Most>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Test::Most You can also look for information at: o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Most <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Most> o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/Test-Most <http://annocpan.org/dist/Test-Most> o CPAN Ratings http://cpanratings.perl.org/d/Test-Most <http://cpanratings.perl.org/d/Test-Most> o Search CPAN http://search.cpan.org/dist/Test-Most <http://search.cpan.org/dist/Test-Most> CAVEATS
The stack trace is likely useless due to how "Test::Builder" internals work. Sorry 'bout that. ACKNOWLEDGEMENTS
Many thanks to "perl-qa" for arguing about this so much that I just went ahead and did it :) Thanks to Aristotle for suggesting a better way to die or bailout. Thanks to 'swillert' (<http://use.perl.org/~swillert/>) for suggesting a better implementation of my "dumper explain" idea (<http://use.perl.org/~Ovid/journal/37004>). COPYRIGHT &; LICENSE Copyright 2008 Curtis Poe, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-05-27 Test::Most::Exception(3pm)
All times are GMT -4. The time now is 08:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy