Need a unix script to convert date into Julian format in a text file
The 6th & 7th column of the text files represents date & time. I need this to be converted in julian format using command "date +%s -d <date>". I know the command, but dont know how to use it on the script
Hi,
I have script in unix which creates a julian date like 126 or 127
I want convert this julian date into calender date
ex : input 127
output 07/may/2007 or 07/05/2007 or 07/05/07
rgds
srikanth (6 Replies)
Dear Experts,
I need your help to convert a unix date and time format number in to readable format like dd/mm/yyyy .
I have a text file of more than 10,000 records and it is like
NAME DATE1 COUNTRY DATE2
ABD 1223580395699 USA 1223580395699... (3 Replies)
I have a comma delimited log file which has the date as MM/DD/YY in the 2nd column, and HH:MM:SS in the 3rd column.
I need to change the date format to YYYY-MM-DD and merge it with the the time HH:MM:SS. How will I got about this?
Sample input
02/27/09,23:52:31
02/27/09,23:52:52... (3 Replies)
Hi All,
I have a string like below.
"Mar 31 2009" .
I want to convert this to unix time .
Also please let me know how to find the unix time for the above string minus one day. For Eg. if i have string "Mar 31 2009" i want to find the unix time stamp of "Mar 30 2009".
Thanks in advance,... (11 Replies)
hi...... thanks for allowing me to start a discussion
i am collecting usb usage details of all users and convert it into csv files so that i can export it into some database..
the input text file is as follows:-
USB History Dump
by nabiy (c)2008
(1) --- Kingston DataTraveler 130 USB... (2 Replies)
Hi guys,
I know if I try to get a julian date using a specific date I can but I try to get the current date I got an error as you can see below:
This one works fine:
date -d "2010/10/30" +%j
But I can't get the current date as below:
`date -d "+%Y/%m/%d`" +%j
Does somebody can... (6 Replies)
Dear Expert
How to convert date in format of YYYY-MM-DD HH:MM:SS to unix format
using a script or command if avaliable
Example
"2011-05-15 18:00:00" is converted to 1330970400
I tried to use option d in date command but no use, Im using solaris 10
Thanks a lot (12 Replies)
Hello All,
I have a date in DD/MM/YYYY format. I am trying to convert this into unix timestamp. I have tried following:
date -d $mydate +%s
where mydate = 23/12/2016 00:00:00
I am getting following error:
date: extra operand `+%s'
Try `date --help' for more information.
... (1 Reply)
Discussion started by: angshuman
1 Replies
LEARN ABOUT REDHAT
ecpg
ECPG(1) PostgreSQL Client Applications ECPG(1)NAME
ecpg - embedded SQL C preprocessor
SYNOPSIS
ecpg [ option... ] file...
DESCRIPTION
ecpg is the embedded SQL preprocessor for C programs. It converts C programs with embedded SQL statements to normal C code by replacing the
SQL invocations with special function calls. The output files can then be processed with any C compiler tool chain.
ecpg will convert each input file given on the command line to the corresponding C output file. Input files preferrably have the extension
.pgc, in which case the extension will be replaced by .c to determine the output file name. If the extension of the input file is not .pgc,
then the output file name is computed by appending .c to the full file name. The output file name can also be overridden using the -o
option.
This reference page does not describe the embedded SQL language. See the PostgreSQL Programmer's Guide for that.
OPTIONS
ecpg accepts the following command-line arguments:
-c Automatically generate C code from SQL code. Currently, this works for EXEC SQL TYPE.
-D symbol
Define a C preprocessor symbol.
-I directory
Specify an additional include path, used to find files included via EXEC SQL INCLUDE. Defaults are . (current directory),
/usr/local/include, the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include), and
/usr/include, in that order.
-o filename
Specifies that ecpg should write all its output to the given filename.
-t Turn on autocommit of transactions. In this mode, each query is automatically committed unless it is inside an explicit transaction
block. In the default mode, queries are committed only when EXEC SQL COMMIT is issued.
-v Print additional information including the version and the include path.
---help
Show a brief summary of the command usage, then exit.
--version
Output version information, then exit.
NOTES
When compiling the preprocessed C code files, the compiler needs to be able to find the ECPG header files in the PostgreSQL include direc-
tory. Therefore, one might have to use the -I option when invoking the compiler (e.g., -I/usr/local/pgsql/include).
Programs using C code with embedded SQL have to be linked against the libecpg library, for example using the flags -L/usr/local/pgsql/lib
-lecpg.
The value of either of these directories that is appropriate for the installation can be found out using pg_config(1).
EXAMPLES
If you have an embedded SQL C source file named prog1.pgc, you can create an executable program using the following sequence of commands:
ecpg prog1.pgc
cc -I/usr/local/pgsql/include -c prog1.c
cc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg
SEE ALSO
PostgreSQL Programmer's Guide for a more detailed description of the embedded SQL interface
Application 2002-11-22 ECPG(1)