Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6765725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:44:45+00:00 2026-05-26T14:44:45+00:00

I have a comma-separated file, with the first column as a date of the

  • 0

I have a comma-separated file, with the first column as a date of the format 01/31/2010
that I want to change into epoch time, such that the file “file.csv”:

 01/30/2010,1,"hi"
 01/31/2010,3,"bye"

will change into “output.csv”:

 1264809600,1,"hi"
 1264896000,3,"bye"

I know the command line date -d “01/30/2010” +%s will work, but only on a single date, and I need to feed it into a table, so, is there a way to use awk with some func():

cat file.csv | awk -F, 'print func($1)","$2","$3}'

Since I don’t really care how I do this, alternatively, how would I change a date in excel into epoch, when the string is mm/dd/yyyy…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:44:46+00:00Added an answer on May 26, 2026 at 2:44 pm
    TZ=PST awk -F, '{split($1,date,"/");
                     $1=mktime(date[3] " " date[1] " " date[2] " " "00 00 00");
                     print}'
    

    Or, invoking date:

    TZ=PST awk -F, '{ OFS = FS;
                      command="date -d" $1 " +%s";
                      command | getline $1;
                      close(command);
                      print}'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that reads data from a comma separated text file and
I have Text file that contains data separated with a comma , . How
I have a comma-separated value file that looks like this when I open it
I have a csv with the first column a label followed by comma separated
I have a comma separated CSV file looks like: customer1,customer2,,customer4, ,customer2,,customer4, custome1,,customer3,, I want
I have a csv file that has 2 columns separated by a comma -
I have comma-separated values. I need a query to insert into SQL Server 2008
I have a HTML form that accepts a comma separated list of tags, which
I have a string ($c) that contains a comma-separated list of settings. Some settings
I have a DB table that contains a comma separated list of ID's (ints)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.