script to convert absolute date


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers script to convert absolute date
# 1  
Old 07-04-2007
script to convert absolute date

Hi ,
I have a csv file and column 1 is date in the cursed YYYY-[M]M-[D]D format. Is there any way to convert 1st column to an absolute date say using 1977-1-1 as day 1?
Thanks a lot.
# 2  
Old 07-04-2007
Read the FAQ article on date arithmetic. Then it's just...

Code:
$ echo $(($(datecalc -j 2007 7 4) - $(datecalc -j 1976 12 31)))
11142
$

# 3  
Old 07-06-2007
Thank you , but how to import date from column one of a csv file and then output it. I'm rusty in file manipulations.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

2. Shell Programming and Scripting

Convert a date stored in a variable to epoch date

I am not able to pass date stored in a variable as an argument to date command. I get current date value for from_date and to_date #!/usr/bin/ksh set -x for s in server ; do ssh -T $s <<-EOF from_date="12-Jan-2015 12:02:09" to_date="24-Jan-2015 13:02:09" echo \$from_date echo... (7 Replies)
Discussion started by: raj48
7 Replies

3. Shell Programming and Scripting

Convert date into days using shell script

Hi, I have date format in an excel sheet as 07/03/2014 11:21. I need to check this date with current date and need to find whether it is more than 30 days or not. I know how to current date into days, but someone please help me to change the date in the excel sheet to days, so that i can check... (2 Replies)
Discussion started by: Arasu123
2 Replies

4. Shell Programming and Scripting

Python script to convert date to iso format

Hi , This is my 1st program in python never tried any python before. i am trying to write a python script which reads a .tsv file line by line and in each line it should look for mm/dd/yyyy formate and convert it to yyyy-mm-dd formate . can some one provide be some sample code to do that. (2 Replies)
Discussion started by: vikatakavi
2 Replies

5. UNIX for Dummies Questions & Answers

How to convert relative path to absolute path?

Hello Everyone, I want to convert Relative Path - /home/stevin/data/APP_SERVICE/../datafile.txt to Absolute Path - /home/stevin/data/datafile.txt Is there a built-in tool in Unix to do this or any good ideas as to how can I implement this. -Steve (5 Replies)
Discussion started by: qwarentine
5 Replies

6. UNIX for Dummies Questions & Answers

Unable to convert date into no. using date -d +%s syntax in ksh shell

hi friends, I m trying to write a script which compares to dates. for this i am converting dates into no using synatx as below v2=`date | awk '{print $2,$3,$4}'` v3=`date +%s -d "$v2"` this syntax is working in bash shell ,but fails in ksh shell. please suggest on this. (12 Replies)
Discussion started by: Jcpratap
12 Replies

7. Shell Programming and Scripting

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 0 dbclstr-b IXT_Web Memphis_Prod_SQL_Full Memphis-Prod-SQL-Full-Application-Backup... (4 Replies)
Discussion started by: ajiwww
4 Replies

8. AIX

Convert string to date in script

Hi, How can I convert a string "Jul 10 09" to date in aix? the output can be like 20090710. Thanks. (4 Replies)
Discussion started by: Gbyte
4 Replies

9. Shell Programming and Scripting

convert Julian date to calender date

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)
Discussion started by: srikanthus2002
6 Replies
Login or Register to Ask a Question