Local const $working_file = @ScriptDir & "\Example Binary File.au3" Local $file_data = FileReadToArray($working_file) For $i = 0 to UBound($file_data) - 1 ; This is just to clean up the line and make the StringSplit function work better ; Making sure there is a space after before and after every '&' and a space after every comma $file_data[$i] = StringReplace($file_data[$i], ")&", ") &") $file_data[$i] = StringReplace($file_data[$i], "&B", "& B") $file_data[$i] = StringReplace($file_data[$i], ',', ", ") $file_data[$i] = StringReplace($file_data[$i], " ", ' ') If (Not StringInStr($file_data[$i], "BinaryToString")) Then ContinueLoop EndIf Local $split_line = StringSplit($file_data[$i], ' ') ; Go through each element in the $split_line array, any line that has BinaryToString in it we need to work with For $p = 0 to UBound($split_line) - 1 If (Not StringInStr($split_line[$p], "BinaryToString")) Then ContinueLoop EndIf Local $start = StringInStr($split_line[$p], "0x") Local $end = StringInStr($split_line[$p], "'", 0, 1, $start) $split_line[$p] = '_' & @CRLF & "BinaryToString(" & SplitBinaryString(StringMid($split_line[$p], $start, $end - $start)) & ',' Next ; Clear $file_data[$i] becase we're going to rewrite it $file_data[$i] = "" ; All the Binary strings have been broken up, now to put the current line for $file_data back together For $p = 1 to UBound($split_line) - 1 $file_data[$i] &= $split_line[$p] & " " Next FileWrite(@ScriptDir & "\Split Example File.au3", $file_data[$i]) Next Func SplitBinaryString($binary_string) ; Each element stores 100 characters of the binary string Local $data[1] = [Null] ; Will hold the full string with the _ @CRLF characters at the en Local $new_string While (StringLen($binary_string) > 100) Local $100_char_string = StringLeft($binary_string, 100) $binary_string = StringTrimLeft($binary_string, 100) $data[Ubound($data) - 1] = $100_char_string ReDim $data[Ubound($data) + 1] WEnd ; If there still some data left in the binary string If (StringLen($binary_string)) Then $data[UBound($data) - 1] = $binary_string EndIf For $i = 0 to Ubound($data) - 1 $new_string &= "'" & $data[$i] & "' & _" & @CRLF Next Return StringTrimRight($new_string, 6) EndFunc