Sponsored Content
Top Forums Shell Programming and Scripting Appending unix timestamp to every line of a statistical file Post 302576324 by thinktank on Thursday 24th of November 2011 09:42:18 AM
Old 11-24-2011
Code:
export TZ=UTC;date -j -f %Y-%m-%d-%H%M%S +%s  1970-01-01-000000

export: Command not found.
date: illegal option -- j
date: illegal option -- f
usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [+format]
date -a [-]sss[.fff]
 

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
PX_DATE2STRING(3)					     Library Functions Manual						 PX_DATE2STRING(3)

NAME
PX_date2string -- Convert paradox date into formated string SYNOPSIS
#include <paradox.h> char * PX_date2string(pxdoc_t *pxdoc, long date, const char *format) DESCRIPTION
Creates a string representation of a paradox date as specified in the parameter format. The date must be either retrieved with PX_get_data_long(3) after calling PX_get_record(3) or by simply using the long value in the pxval_t struct as returned by PX_retrieve_record(3). The function uses internally the PX_timestamp2string(3) function. The format string may contain all chars as docu- mented with PX_timestamp2string(3), though only those concerning the date will produce resonable results. RETURN VALUE
Returns pointer to string on success and NULL on failure. SEE ALSO
PX_timestamp2string(3), PX_time2string(3) AUTHOR
This manual page was written by Uwe Steinmann uwe@steinmann.cx. PX_DATE2STRING(3)
All times are GMT -4. The time now is 02:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy