Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Notepad++ how to add some characters after some commas occurrence?

I have a long insert data sequences text like :

INSERT INTO table (field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field)
VALUES (1, '3110000000', 2, '21/01/2011 12:06', '1016', 1, 2, 'asdddasdsd', 'addasddadsd', 'adadadaddaddssaddaadddddddsadsd', 'asdasdsdsdadsadsadadasd', '06003160485', 'adadasdddaddadddds', '50124', 'asdsdaddad', 'asddasdadsad', '03321807576', NULL, '20110121 12:07:00', 1, NULL, NULL, 22),.....

and I need to reformat this field ‘20110121 12:07:00’ as ‘2011-01-21 12:07:00’…. how I can add those line character for all inserts quickly maybe considering count of fields separated by commas?

Thanks in advance!
Cheers!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Assuming you want to target that literal string in any column, you may use the following find and replace in regex mode:

Find:    '(\d{4})(\d{2})(\d{2}) (\d{2}:\d{2}:\d{2})'
Replace: '$1-$2-$3 $4'

Demo

If you really only want to target the 19th column, then we would need to slightly modify the regex pattern.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading