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
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
I have a string like this :
Global $Msga = "urrent directory is /send. (Submission of file with log number 29381077284 is confirmed)";
I want to extract the number 29381077284 from the string. I did StringSplit to split based on "(" and then use space to reach there, But it's not a good choice.
Can anyone help me with regular expression to find the number from String using AutoIT. TIA
I have this example string:
2020-06-08 09:23:33 : abcdefghifjklm How to trim just the right part? Or how to trim this text right to left?
I want to trim this string right to left until ' : '.
In ohter words: I need the 'abcdefghifklm' text.
I have tried StringTrimRight, but that requires
The number of characters to trim. Unfortunately StringSplit trims the left part of the strings.
This is my take on string triggers, triggers on specific strings.
Able to simple text pasting,
opening links (as long as there's a www. http:\\ or https:\\ at the beggining)
and is able to open applications, if there is a parameter in the parameter field, it uses it.
Shows your external, lan, and gateway ip's.
Able to change system volume by a set percentage, reading from the inputbox the number the user sets, if 0 or empty uses system default.
I made this because the existing string trigger applications didn't do it for me.
I did this for me, but if someone finds it useful, all the better.