在记事本++中查找并替换重新排序的日期格式 [英] Find and replace with reordered date format in notepad++

查看:292
本文介绍了在记事本++中查找并替换重新排序的日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有几千行的文件被添加到MySQL数据库。行中的日期值为dd-mm-yyyy格式,但我需要它们为yyyy-mm-dd格式。



例如, '11 -04-2010',需要成为'2010-04-11',在每一行。 p>

在记事本++或其他文本编辑器中是否有简单的方法?

解决方案



查找:([0-9] +) - +([0-9] + ) - +([0-9] +)



替换:\3-\2-\1


I have a file with a few thousand rows to be added to a MySQL database. There are date values in the rows which are in the dd-mm-yyyy format but I need them to be in the yyyy-mm-dd format.

E.g., '11-04-2010', needs to become '2010-04-11', in every row.

Is there a simple way to do this in notepad++ or another text editor?

解决方案

You can do this with Textpad:

Find: ([0-9]+)-+([0-9]+)-+([0-9]+)

Replace: \3-\2-\1

这篇关于在记事本++中查找并替换重新排序的日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆