Jump to content
Sign in to follow this  
tom2pd

find and replace bytes

Recommended Posts

tom2pd

friends, i want to find and replace byte blocks in file.. using autoit

like this tool Swiss File Knife

advance please..

Thanks...

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
tom2pd

thankz...........

if i use "StringRegExp" can i replace byte blocks???

Share this post


Link to post
Share on other sites
Melba23

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

 

Share this post


Link to post
Share on other sites
tom2pd

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:

Share this post


Link to post
Share on other sites
Melba23

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

 

Share this post


Link to post
Share on other sites
tom2pd

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:;)

Share this post


Link to post
Share on other sites
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
tom2pd

:doh:;):oops:

i have not good reason... :bye:

I just Want it like a *.AVI file ;):cheer:

Share this post


Link to post
Share on other sites
tom2pd

:doh:;):oops:

i have not good reason... :bye:

I just Want it like a *.AVI file ;):cheer:

please Help me

Swiss File Knife this tool can easly do this but i want to do using Autoit

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×