Sign in to follow this  
Followers 0
Chimaera

Trying to combine 2 lines

8 posts in this topic

#1 ·  Posted (edited)

On a script i have this scenario which im trying to solve

If IsArray($CleanUpData) Then
Select
Case IsArray($CleanUpData)
$aRarFile = _RecFileListToArray(@ScriptDir, "*.rar|*.part*", 1, 0) ;<<<<<<<<<<< this one
_ArrayDisplay($aRarFile, ".Rar Files")
Case IsArray($CleanUpData)
$aRarFile = _RecFileListToArray(@ScriptDir, "*.part1.rar;*.part01.rar;*.part001.rar;*.7z;*.001", 1, 0) ;<<<<<<<<<<< and this one
_ArrayDisplay($aRarFile, ".Rar Files")
Case Else
$aZipFile = _RecFileListToArray(@ScriptDir, "*.zip", 1, 0) ; Search for .zip files
_ArrayDisplay($aZipFile, ".Zip Files")
EndSelect

 

The problem is i have no case arguments that i can use other then IsArray($CleanUpData)

and the case else must be the zip

How can i combine the 2 marked lines without causing the conflict of single rar ignoring the part and also to find the part.rar when needed?

Or a way to make it do both searches and only keep the right one?

Basically it only looks for the first file only

If this makes no sense i will try and explain again ;)

Edited by Chimaera

Share this post


Link to post
Share on other sites



If you can't combine everything into a single call to _RecFileListToArray then fill two arrays and combine them using function _ArrayConcatenate.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

arent these items  "*.part1.rar;*.part01.rar;*.part001.rar" included in the first _recfilelist as "*.rar", leaving only .7z and .### files?

And the first one is seperated with a pipe and the second with semicolons, should they both be semicolons or are there fun undocumented features of _RecFileListToArray?


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

*.rar|*.part* = search for *.rar | but exclude from the search any files with this present *.part*

Its documented a s far as i know in the header

and there is a third type of exclusion but i never use it

edit maybe i should add older rar forms were .rar / .r01/ .r02 etc, modern ones have the part bit in them *.part1.rar *.part2.rar, i have to catch both

Edited by Chimaera

Share this post


Link to post
Share on other sites

hmmm, maybe im on an old version, but i see exclude list at the end, and still semicolon seperated.

Func _RecFileListToArray($sInitialPath, $sInclude_List = "*", $iReturn = 0, $iRecur = 0, $iSort = 0, $iReturnPath = 1, $sExclude_List = "", $sExclude_List_Folder = "")

$sExclude_List - Optional: filter for excluded results (default ""). Multiple filters must be separated by ";"


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Melba changed the syntax a while ago to simplify i beleive

Syntax.........: _RecFileListToArray($sPath[, $sMask = "*"[, $iReturn = 0[, $iRecur = 0[, $iSort = 0[, $iReturnPath = 1[, $sExclude_List = ""[, $sExclude_List_Folder]]]]]]])

Edited by Chimaera

Share this post


Link to post
Share on other sites

To Combine two line you may use these ;

$Line1 = "Autoit"
$Line2 = ".rar"
$Combine = $Line1 & $Line2
MsgBox(0,"",$Combine)

To select true array you may create a loop While/Wend and add If command . Like If $Array = "Your True Text" Then ExitLoop .

Loken

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0