tom2pd Posted March 5, 2012 Share Posted March 5, 2012 friends, i want to find and replace byte blocks in file.. using autoitlike this tool Swiss File Knifeadvance please..Thanks... Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 5, 2012 Moderators Share Posted March 5, 2012 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 More sharing options...
tom2pd Posted March 5, 2012 Author Share Posted March 5, 2012 thankz........... if i use "StringRegExp" can i replace byte blocks??? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 5, 2012 Moderators Share Posted March 5, 2012 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. 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tom2pd Posted March 5, 2012 Author Share Posted March 5, 2012 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. 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 ;) if i read big file,bytes into a veriable, is my pc get a poblem(sorry about my bad english) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 5, 2012 Moderators Share Posted March 5, 2012 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? What size of file and block are we talking about? M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tom2pd Posted March 5, 2012 Author Share Posted March 5, 2012 ex: i want replace byte on 1GB file, not All byte blocks, like find 0xFF and relpace 0xA7 just i want to test this.... Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2012 Developers Share Posted March 5, 2012 ex: i want replace byte on 1GB file, not All byte blocks, like find 0xFF and relpace 0xA7just i want to test this.... .. 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 More sharing options...
tom2pd Posted March 5, 2012 Author Share Posted March 5, 2012 i have not good reason... I just Want it like a *.AVI file Link to comment Share on other sites More sharing options...
tom2pd Posted March 5, 2012 Author Share Posted March 5, 2012 i have not good reason... I just Want it like a *.AVI file please Help meSwiss File Knife this tool can easly do this but i want to do using Autoit Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2012 Developers Share Posted March 5, 2012 Please go and play somewhere else and come back when you have a serious question. 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 More sharing options...
Recommended Posts