faqts : Computers : Programming : Languages : Tse : Search

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 1 people (100%) answered Yes
Recently 1 of 1 people (100%) answered Yes

Entry

TSE: File: Search/Replace: Character: Hexadecimal: How to replace a hexadecimal character?

Dec 11th, 2003 13:21
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 11 December 2003 - 07:59 pm -------------------

TSE: File: Search/Replace: Character: Hexadecimal: How to replace a 
hexadecimal character?

---

Use the notation

\x<the hexadecimal character value you want to replace>

---
---

Method: Manually replacing

---

For example:

I want to replace the ù character (hex 97) by
u instead.

Steps: Overview:

 1. -Open TSE

 2. -Load the one or more files in which you want to replace

 3. -select from menu option <ESCAPE>

 4. -Press the 'S' to 'S'earch

 5. -Press the 'R' to 'R'eplace

 6. -In the text box type the following:

      \x97

 7. -Press <ENTER>

 8. -Press the new string you want to replace with

      e.g. type

       u

 9. -Press <ENTER>

10. -Supply the replace options

      e.g. type:

       ngax

      where
          'n' means 'n'ot asking for replace
      and 'g' means 'g'lobal, thus in the whole file
      and 'a' means 'a'll files that are currently loaded
      and 'x' means a regular e'x'pression

---
---

Method: Using a macro and LReplace() or Replace()

---

The general format of LReplace() and Replace() is:

 LReplace( <your originalstring>, <your replace string>, <your replace 
options> )

---

For example:

I want to programmatically replace the ù character (hex 97) by u 
instead.

---

Run for example the following macro:

PROC Main()
 LReplace( "\x97", "u", "ngax" )
END

That will replace the hexadecimal character 97 by the character u,
without asking, in all the loaded files (using a regular expression).

---
---

---
---

Internet: see also:

---

TSE: File: Search/Replace: Character: Decimal: How to replace a 
decimal character?
http://www.faqts.com/knowledge_base/view.phtml/aid/27323/fid/865

----------------------------------------------------------------------