S
S
s_katala2016-12-10 17:33:06
MySQL
s_katala, 2016-12-10 17:33:06

How to bulk replace line endings in sql file?

Guys tell me how to replace line endings in bulk?
I have over 5000 thousand lines in manual long time!
here is an example

(1100, 1, 31, 'Богородское', '', 'bogorodskoje-mo', '', 1, 0, 3, 55, 0, 0),
(1102, 1, 31, 'Большевик', '', 'bolshevik', '', 1, 0, 3, 61, 0, 0),
(1106, 1, 31, 'Бронницы', '', 'bronnicy', '', 1, 0, 3, 73, 0, 760),

It needs to be
(1100, 1, 31, 'Богородское', '', 'bogorodskoje-mo', 0),
(1102, 1, 31, 'Большевик', '', 'bolshevik',  0),
(1106, 1, 31, 'Бронницы', '', 'bronnicy', 0),

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
s_katala, 2016-12-10
@s_katala

Solution
'',\s*\d+,(.*?)\)
to ", 0)" (no quotes)

M
mletov, 2016-12-10
@mletov

As an option:
- import into the database
- delete extra columns
- update the last one to 0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question