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 7819617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:01:08+00:00 2026-06-02T07:01:08+00:00

I need to copy .csv files from one directory to another, and while doing

  • 0

I need to copy .csv files from one directory to another, and while doing so need to reformat the first column, which is a date column, from 13/04/2012 to 2012-04-13. What is the sed syntax to perform this simple conversion? I am getting awfully confused by the sed stuff I’m reading on the web.

  • 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-06-02T07:01:12+00:00Added an answer on June 2, 2026 at 7:01 am

    What have you tried so far? You could start with something small like this as a test case:

    echo "13/04/2012;Col2;Col3" | sed -E 's#^([^/]+)/([^/]+)/([0-9]+)(.*)#\3-\2-\1\4#'
    
    s           = substitution command
    #           = start of pattern
    ^           = start of line
    ([^/]+)/    = group of all non-/-characters followed by a / (day)
    ([^/]+)/    = group of all non-/-characters followed by a / (month)
    ([0-9]+)    = group of at least one digit (year)
    (.*)        = rest of line
    #           = start of replacement
    \3          = backward reference to capture of third group (year)
    \2          = backward reference to capture of second group (month)
    \1          = backward reference to capture of first group (day)
    \4          = backward reference to capture of fourth group (rest of line)
    # end of command
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to copy files in one directory to another directory where the lastwritetime
I need to copy a jar file from one directory to another when my
I need to copy a table from one server to another.for that I have
I need to copy data from one table to another. The tables do not
I need to copy a few files to another directory. The source structure is
I need to copy about 40 databases from one server to another. The new
I need to copy several tables from one DB to another in SQL Server
I need to copy all *.exe files in some directory to other virtual drive
I need to copy a node and its sub-nodes: first: one identical copy followed
I've one situation where I need to copy part of the data from one

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.