Jump to content

Help with line breaks mid-string - (Moved)


alkado
 Share

Go to solution Solved by Jos,

Recommended Posts

So I am looking at a relatively simple albeit long script I need to compile, however it has been left as practically deprecated and I want to get it working.

Now, the lines I need to work with are way over the character limit, and I'm seeing the lines broken up mid-string. Example from part of an array attached.

I simply want to use a find/replace on the many instances of ' & ' with something that works, as this doesn't break the line the way I need it to, and thus I cannot compile it. I'm aware of manual ways to do this between strings of data, but I am dealing with a lot of code and would much rather make use these breaks as it would turn days of work into maybe an hour. I know that there's a chance that it simply cant be this easy, but I figured the least I could do is ask.

Forgive me if this sounds stupid but this is not my area of expertise by any means.

demo.txt

Link to comment
Share on other sites

  • Developers
  • Solution

So the attached txt file is one line from your script that isn't working ....right?

Just change the 

xxxx' & 'yyyy

in that script to 

xxxx' & _ 
'yyyy

and things will work.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers
2 minutes ago, Nine said:

how?

image.png.fabff2faf14d2c87f2894e065493939d.png

This is SciTE functionality not Scintilla.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers
2 minutes ago, Nine said:

I was trying with Regular expression

That actually also works:

image.png.a3c87a5bd16b795d8497036efa69b36f.png

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Quote
  • \a, \b, \f, \n, \r, \t, \v match the corresponding C escape char, respectively BEL, BS, FF, LF, CR, TAB and VT;
    Note that \r and \n are never matched because in Scintilla, regular expression searches are made line per line (stripped of end-of-line chars).

That's what mingled me...I was trying to search first and it was not working.  Never really tried with just a replacement.

Thanks Scite guru :)

Link to comment
Share on other sites

  • Developers

I normally use the first option when just replacing tabs/CRs/LFs to keep things simple and not having to worry about any special regex characters, but it is quite useful ones you get the hang of it. :)  

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers
24 minutes ago, ad777 said:

this should works for you i did little fix:

What exactly was wrong with what we gave as solution ?   ...   and why such a complex alternative when standard concatenation spread over multiple lines works fine as well?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

I know but:

  1. The question whether this is really needed or just creating confusion?
  2. Your proposed solution as such is not one I would advice to use in general as I mentioned.

Just putting it out there..... but you don't have to provide a solution in every posted thread. ;) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Thanks for the quick and useful answers! All of your answers can help me out since I'm newer here, I just feel a little silly that the solution was that simple.

And mods, thanks for moving this to the right place, forgive my ignorance.

 

Link to comment
Share on other sites

Just to add. I love me some Notepad++, but its handy ability to keep files open in memory even if not saved has its usefulness reserved elsewhere for me.

I use Atom for projects like this, a very handy program, and it is also capable of regex find and replace.

Link to comment
Share on other sites

And, because I cant keep my thoughts organized, I'll add on this here third post that the code I'm dealing with is over 74,000 lines long, so any solution that bypasses having to manually enter even a single character outside of the replace tool is just not realistic seeing that I have that option to choose from already.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...