KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am writing a bash script that reads a file line by line. The file is a .csv file which contains many dates in the format DD/MM/YYYY but I would like to change them to YYYY-MM-DD. I would to match the data using a regular expression, and replace it such that all of the dates in the file are correctly formatted as YYYY-MM-DD. I believe this regular expression would match the dates: ([0-9][0-9]?)/([0-9][0-9]?)/([0-9][0-9][0-9][0-9]) But I do not know how to find regex matches and replace them with the new format, or if this is even possible in a bash script. Please help!
Tags (comma-separated)
Save Edits
Cancel