Recently Browsing 0 members
No registered users viewing this page.
$input = $CmdLine $bytes = 1000000 ; 1000000 for 1 MB, 1000 for 1 KB $size = FileGetSize($input) $file = fileopen($input, 16) $max = ceiling($size / $bytes) for $i = 1 to $max $data = fileread($file, $bytes) $output = $input & '_' & $i & 'of' & $max filewrite($output, $data) next ^file split
file path for a 20MB "video.mp4" is input, it will be output as "video.mp4_1of20", "video.mp4_2of20", etc. change $bytes to affect the split files size, this example made them 1MB (10^6 bytes)
$input = $CmdLine $name = stringtrimright($input, 1 + stringlen($input) - stringinstr($input, '_', 0, -1)) $split = stringsplit($input, 'of', 3) $max = $split[ubound($split) - 1] for $i = 1 to $max $in = $name & '_' & $i & 'of' & $max $file = fileopen($in, 16) $data = fileread($file) fileclose($file) filedelete($in) filewrite($name, $data) next ^ file join
file path for any of the "video.mp4_Xof20" segments is input. the "video.mp4_Xof20" segments are read and written to "video.mp4" and then deleted, leaving the newly joined "video.mp4" in the end
i made this today because i had a big file that i couldn't really open. i split it into 1000 chunks to make processing and stuff easier. i've also used it to split files to just under 25MB segments so i can attach and mail big files over gmail which is silly but it worked
This is a program that I made to help my self learn better regular expressions.
There are a lot of other programs/website with the similar functions.
The main advantage of this program is that you don't have to click a button after every changes.
The program detected changes and react on it.
Match Match of arrays Match and replace Load source data from website Load source data from a website with GET/POST Load text data from file Clear fields Export and Import settings (you can finish the expression a other time, just export/import it) Cheat sheet DPI aware Generate AutoIt code example code The source code is not difficult and I think most user will understand it.
In the zip file there is a export files (reg back example), you can drag and drop this files on the gui to import it.
EDIT: Updated to version V1.2.0
Expand and collapse of the cheat sheet (Thanks to Melba23 for the Guiextender UDF) Usefull regular expressions websites links included in the program Text data update time EDIT: Updated to version V1.3.0
Automatic generate AutoIt code Icons on the tab Few minor bug fixes EDIT: Updated to version V1.4.0
Link to AutoIt regex helpfile If the regular expression has a error than the text becomes red Option Offset with Match and array of Matches Option Count with Match and replace Some small minor bug fixed EDIT: Updated to version V1.4.1
Small bug in "create AutoIt" code fixed EDIT: Updated to version V1.4.2
Small bug in "create AutoIt" code fixed Bug with website data fixed EDIT: Updated to version V1.4.3
DPI aware Click function on cheat sheet to insert function in the regex input field
(Sourcode, example and compiled exe file) Regex toolkit.zip
is there a regular expression pattern that can be used to remove part of a string based on the position of the substring, that is, by specifying the start and end characters of the block to remove? thus obtaining a new string without the "piece" indicated.
Global $sString = "Today I do not feel good" ; chars: 000000000111111111122222 ; 123456789012345678901234 ; remove a chunk from char 9 to char 15 MsgBox(0, '', _StringTrimMid($sString, 9, 15)) ; Returns the string trimmed by characters from $iStartCut to $iEndCut. Func _StringTrimMid($sInput, $iStartCut, $iEndCut) Return StringLeft($sInput, $iStartCut - 1) & StringMid($sInput, $iEndCut + 1) ; can be done the same with a RegExp ?? EndFunc ;==>_StringTrimMid
here is an example about how to split your texts using a delimiter with the ability to select how much of delimiters shows in each colum with $i_number
you have a long text and you want to split it in an array
that evry colum have a number (n) of lines
i made a function that do that for you
just call it with a three params
the number that you want to put in each col
default is "|"
here is the function with example
i hope that it will be useful for you
#include <Array.au3> $s_txt = "some text1some text2|some text3|some text4|some text5|some text6" $array = splitText($s_txt, 2) _ArrayDisplay($array) Func splitText($s_text, $i_number, $s_siparator = "|") Local $a_TXT = StringSplit($s_text, $s_siparator) Local $a_Return[$a_TXT + 1] If ($a_TXT <= $i_number) Or ($i_number <= 0) Then ReDim $a_Return $a_Return = 1 $a_Return = $s_text Return $a_Return EndIf Local $i_Processed = 1, $i_arrayProcessed = 1 Do For $i = $i_Processed To ($i_Processed + $i_number) - 1 If ($a_TXT < $i) Then ExitLoop If Not ($a_Return[$i_arrayProcessed]) Then $a_Return[$i_arrayProcessed] = $a_TXT[$i] Else $a_Return[$i_arrayProcessed] &= $s_siparator & $a_TXT[$i] EndIf $i_Processed += 1 Next $i_arrayProcessed += 1 Until ($a_TXT < $i_Processed) ReDim $a_Return[$i_arrayProcessed] $a_Return = $i_arrayProcessed - 1 Return $a_Return EndFunc ;==>splitText
accept my greetings
for his notes
Please help me to change metasymbol line. Right now I have this condition code:
If StringInStr($_sName, 'TEXT ') Then $_sName = StringRegExpReplace($_sName, '(^.*)\TEXT (.*)$', '$2') $_sName = StringRegExpReplace($_sName, '(^.*)\ (.*)$', '$1') If Not CheckIsSave_($_sName) Then It work fine with this text file and finds each line which start from 'TEXT':
Material B7E671143D244B ==================================== TEXT 2F3139D816C34D 1 TEXT B6A968EF2505A2 1 TEXT 35206697A04F91 1 TEXT EB485AF490D83D 1 TEXT 0DAB42294BD9B3 1 TEXT 3D6525BEE360E1 0 Material D6906B886B06E3 ==================================== TEXT 0CCECCCCFB62AE 1 TEXT 1E14CB29AB43F0 1 TEXT FB7F0DCE9B5950 1 But I have a new text file now the lines of which now are start with 0:, 1: and so on:
sm_0 --------------- 0: dummy_gray 1: c_com_socksa_mt 2: c_com_socksa_tn 3: dummy_white 4: default_z 5: dummy_nmap 6: --- 7: --- sm_1 --------------- 0: c_com_prisoner_shoes_di 1: c_com_prisoner_shoes_mt 2: c_com_prisoner_shoes_tn 3: dummy_white 4: default_z 5: c_com_leatherb_rt 6: --- 7: --- how to change (or add) the condition code above to work with new text file?
I'm trying to change this script: http://autoit-script.ru/threads/poisk-fajlov-rekursivno-po-dannomu-spisku.26970/post-148646