Jump to content

find and replace bytes


Recommended Posts

  • Moderators

Hi, tom2pd, welcome to the forum. For searching through a file and replacing strings with different filters, I would suggest looking up the StringRegExp tutorial in the help file.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

tom2pd,

Use FileRead with a binary flag to get the bytes into a variable. Then you can use StringReplace or StringRegExp (depending exactly what you want to replace with what). Finally use FileWrite to rewrite the file. :oops:

Check out those functions in the Help file and see what you can come up with. You know where we are if you run into difficulties. :bye:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

tom2pd,

Use FileRead with a binary flag to get the bytes into a variable. Then you can use StringReplace or StringRegExp (depending exactly what you want to replace with what). Finally use FileWrite to rewrite the file. :bye:

Check out those functions in the Help file and see what you can come up with. You know where we are if you run into difficulties. ;)

M23

;) ;) :cheer::bye:

if i read big file,bytes into a veriable, is my pc get a poblem

(sorry about my bad english) :oops::bye::doh:

Link to comment
Share on other sites

  • Moderators

tom2pd,

Then you need to use a buffer to only read in part of the file at a time and the whole thing becomes at least one level more difficult. For example, what happens if the buffer cuts one of your blocks into two? :bye:

What size of file and block are we talking about? :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Developers

ex: i want replace byte on 1GB file, not All byte blocks, like find 0xFF and relpace 0xA7

just i want to test this.... :oops::bye::doh:;)

.. and you are serious... right?

Just give me one good reason to want this.

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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