Community discussions

MikroTik App
 
WeWiNet
Long time Member
Long time Member
Topic Author
Posts: 597
Joined: Thu Sep 27, 2018 4:11 pm

Winbox script formatting removing line breaks

Thu Jul 01, 2021 12:47 pm

Hi, how can you tell Winbox v3.28 to not screw up from time to time formatting of scripts? (this by the way has been a problem since ever for me)
It just removes/loose the \r at line end and you get the complete script as a single line... impossible then to edit or understand what the script does.

Those scripts which are displayed correctly do have the \n at the beginning and \r at the end.
Those scripts displayed incorrectly do miss the \r at the end of the line... how can this get lost ???

Why happens this suddenly randomly on some scripts, and if it happened, any simple way to get the good format back?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Winbox script formatting removing line breaks

Thu Jul 01, 2021 1:01 pm

Only novel, no concrete examples, I just suppose you are not able to use the things on correct way, from hint "this by the way has been a problem since ever for me"

the \r\n are for "carrier return/line feed" are what go to next line on text editor, thanks to those the script go to next line

Instead of editing script inside exported cofiguration, work directly as all other user directly inside "source" field on winbox.

Is not MikroTik problem if you do your works on wrong way.
If \r and \n are present there is a reason, if you delete them, what you expect?
 
WeWiNet
Long time Member
Long time Member
Topic Author
Posts: 597
Joined: Thu Sep 27, 2018 4:11 pm

Re: Winbox script formatting removing line breaks

Fri Jul 02, 2021 11:10 am

I do not edit the script offline in a editor. I always only use Winbox for script editing.
Its winbox or ROS or the backup/import process which screws up the formatting!
And I thought some others might have had similar experience and could share...

I do not know when/which condition the formatting gets lost...
I do not go into each of my 30 script and 20 schedules after each and every upgrade of ROS to see is formatting changed!

It could also be that this happens after installing a "backup" when the device has been previously locked.
But again I do not check each script/schedule display format after such process which should be transparent.

And here I do talk about scripts of 50+ lines. So in no way could I go in and remove all the line breaks of ONE script manually.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Winbox script formatting removing line breaks

Fri Jul 02, 2021 11:25 am

Still your problem.

You can not open a export and paste directly inside winbox script field.
Export is... for import on terminal, not to be copied and paste inside a winbox script field.

You wrong, is you the problem that not understand how the things works.
 
WeWiNet
Long time Member
Long time Member
Topic Author
Posts: 597
Joined: Thu Sep 27, 2018 4:11 pm

Re: Winbox script formatting removing line breaks

Fri Jul 02, 2021 11:41 am

Why do you write such things in agressive way? " you do not know ..."

Just ignore this thread and go somewhere else if you can not advice anything helpful.
Thank you
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Winbox script formatting removing line breaks

Fri Jul 02, 2021 11:56 am

I can't ignore a title "Winbox script formatting removing line breaks",
which seems more like a verdict than a request for help or explanation.

Whatever happens, I've explained how things work, like it or not, now you know.

Who is online

Users browsing this forum: Bing [Bot], washdogg87, wmc2014 and 100 guests