Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

How to remove the Linebreak Special Character in notepad?



  • Please log in to reply
4 replies to this topic
viperzero
  • Members
  • 14 posts
  • Last active: Aug 07 2016 04:00 PM
  • Joined: 25 Apr 2013

I need your help guys. I need to delete the Linebreak Special Character in a variable clip taken from notepad. However, autohotkey doesn't seem to recognize the character and returns with an error everytime I tried to replace it. The said character doesn't appear in this post, but instead it is automatically displayed as an automatic linebreak. How can I do this?

 

 

PS: The linebreak special character is viewed in notepad as a small-square-character-thingy.



noname
  • Members
  • 650 posts
  • Last active:
  • Joined: 12 Nov 2011

Why not open it in a hexeditor to see what exactly the character code is? You can use an online hexviewer if the file does not contain sensitive info:

 

http://www.fileforma...ool/hexdump.htm

 

Or just code it with ahk or download a free hexviewer   http://mh-nexus.de/en/hxd/


winXP  and ahk unicode


viperzero
  • Members
  • 14 posts
  • Last active: Aug 07 2016 04:00 PM
  • Joined: 25 Apr 2013

I can't that would be too much work and time, the reason I'm asking this is because I need to eliminate the character for my script to work since the string I'm copying consists too much it that it messes with the timing of the script.



noname
  • Members
  • 650 posts
  • Last active:
  • Joined: 12 Nov 2011
✓  Best Answer

I did not mean to use a hexeditor to clean up your file only to find the character code that is giving trouble!

If you know the character then it must be easy to code to remove it. ;)

 

 

Regex has a \v that means "vertical linebreak" you could use it to see if it will removes the one you have if you do not find the exact character using hex.

 

example:

data=
(
line1
line2
line3
)

msgbox % regexreplace(data,"\v")
msgbox % regexreplace(data,"\v","`n") ;replaces all vertical linebreaks with "newline"

winXP  and ahk unicode


viperzero
  • Members
  • 14 posts
  • Last active: Aug 07 2016 04:00 PM
  • Joined: 25 Apr 2013

Now THAT is what i'm looking for, the solution for the problem that's been bugging me for days. 

msgbox % regexreplace(data,"\v")

That alone is enough, thank you, you're a big help. Here is my code:

Date2x := regexreplace(Date2x,"\v")

PS: I don't have to use the hexeditor. :)