Jump to content

Recommended Posts

Posted

I'm sorry that I'm asking the same question so many times, but it's because that it really does not work.. It doesn't include the subfolder.

#Include <File.au3>
#include<FileListToArray3.au3>
Local $sPath1 = @ScriptDir, $filter = "*.txt"; $filter = "*.txt" to get all text files in subdirs
Local $FileList = _FileListToArray3($sPath1, $filter, 1, 1, 1);,"",

$Location = @DesktopDir&"\"
$FileList = _FileListToArray($Location)
If @error = 1 Then
    MsgBox(0, "", "No Files\Folders Found.")
    Exit
EndIf
$Opener = FileOpen($Location & "All_Files.txt", 2)
For $X = 1 To UBound($FileList) - 1
    ToolTip("File #" & $X, 10, 10, "Tecter", 1)
    If StringInStr($FileList[$X], ".txt") Then
        FileWrite($Opener, FileRead($Location & $FileList[$x]))
        FileWrite($Opener, @CRLF & @CRLF & "************* Divider **************** File Number = " & $x & @CRLF & @CRLF)
    EndIf
Next
FileClose($Opener)
ShellExecute($Location & "All_Files.txt")

When i run the script below with the FileListToArray3.au3, which I've downloaded from you, in the scriptdir then it would still not work. I have done everything of what you say and I'm not fooling around with your, but I simply can't make it work.

Are you maybe running the beta of autoIt or something.? because then I would try install that..

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

I'm sorry that I'm asking the same question so many times, but it's because that it really does not work.. It doesn't include the subfolder.

#Include <File.au3>
#include<FileListToArray3.au3>
Local $sPath1 = @ScriptDir, $filter = "*.txt"; $filter = "*.txt" to get all text files in subdirs
Local $FileList = _FileListToArray3($sPath1, $filter, 1, 1, 1);,"",

$Location = @DesktopDir&"\"
$FileList = _FileListToArray($Location)
If @error = 1 Then
    MsgBox(0, "", "No Files\Folders Found.")
    Exit
EndIf
$Opener = FileOpen($Location & "All_Files.txt", 2)
For $X = 1 To UBound($FileList) - 1
    ToolTip("File #" & $X, 10, 10, "Tecter", 1)
    If StringInStr($FileList[$X], ".txt") Then
        FileWrite($Opener, FileRead($Location & $FileList[$x]))
        FileWrite($Opener, @CRLF & @CRLF & "************* Divider **************** File Number = " & $x & @CRLF & @CRLF)
    EndIf
Next
FileClose($Opener)
ShellExecute($Location & "All_Files.txt")

When i run the script below with the FileListToArray3.au3, which I've downloaded from you, in the scriptdir then it would still not work. I have done everything of what you say and I'm not fooling around with your, but I simply can't make it work.

Are you maybe running the beta of autoIt or something.? because then I would try install that..

Hi,

I still can't believe this!

You have again posted a non-working script, when all you have to do is copy the script from post#38!

What is your problem?

Best, Randall

Posted

:) you must think that i'm an idiot :)

But it's not that simple.. In your post #38 it doesn't work with those file I need to combine. :/

It is might because of the null character, cause if you try using the script to combine the files with I've uploaded with this post, then you can see that it's only takes the beginning of the text file.. I hope you see what I mean, because this script does almost the same as WeaponX's script and it is also stopped when meeting the "null".

And I can't figure out how to make it work.. try see if you can combine the files that I've posted in the zip, when letting them stay in their directories after extracting the .zip :)

If you can do that, then the script work.. Right now I can't combine them with the script as it is now.

Regards

peter.zip

Posted

Hi

I thought we already beat that hurdle; see post #18;

Replace any File read with; StringReplace(FileRead($current & "\" & $file),chr(0),"")

So; post #38 becomes;

#include<FileListToArray3.au3>
#Include <File.au3>
#Include <array.au3>
Local $Location = @DesktopDir & "\", $sFileResult = $Location & "All_Files.txt";to write
Local $sPath1 = @ScriptDir, $filter = "*.txt"; $filter = "*.txt" to get all text files in subdirs
Local $FileList = _FileListToArray3($sPath1, $filter, 1, 1, 1);,"",
;~ $FileList = _FileListToArray($Location) ; what are you trying to do with this line?
ConsoleWrite("Number of Files; $FileList[0]=" & $FileList[0] & @LF)
_ArrayDisplay($FileList, "$FileList")
If $FileList[0] = 0 Then
    MsgBox(0, "", "No Files\Folders Found.")
    Exit
EndIf
$hOpener = FileOpen($sFileResult, 2)
For $X = 1 To UBound($FileList) - 1
    ToolTip("File #" & $X, 10, 10, "Tecter", 1)
    FileWrite($hOpener, StringReplace(FileRead($FileList[$X]),chr(0),"")); filelist alreasdy has base directory in string; $Location; ;*********************** REPLACE NULLS
    FileWrite($hOpener, @CRLF & @CRLF & "************* Divider **************** File Number = " & $X & @CRLF & @CRLF)
Next
FileClose($hOpener);

ShellExecute($Location & "All_Files.txt")

Let me know..

Posted

Now it finally works.. It's finding all the subfolders from the desktop and put all the txt files together..

the only problem is that it's taking ALL files from the list no also even if you don't select them. how do I fix that?

Posted (edited)

Now it finally works.. It's finding all the subfolders from the desktop and put all the txt files together..

the only problem is that it's taking ALL files from the list no also even if you don't select them. how do I fix that?

Hi,

Halfway, then!

What ones do you want to select?; it should be getting "*.txt" files; are you saying it is getting others too?

[ie change filter to "a*.txt", for intance, if you want those text files starting with "a".. etc]

Best, Randall

Edited by randallc
Posted

Hi

yes :)

I wasn't thinking about the filter. It works fine..

I was thinking about if it is possible to only combine the file which you mark and then press textselected ?

Or is it too complicated ? I would be great it can be figured out like that.

regards and thanks

Posted

Hi

yes :)

I wasn't thinking about the filter. It works fine..

I was thinking about if it is possible to only combine the file which you mark and then press textselected ?

Or is it too complicated ? I would be great it can be figured out like that.

regards and thanks

Hi,

Yes, but you have to

1. Select them.

2. press "Copy" button in ArayyDisplay.

3. Exit Array Display

Best, randall

; filelisttoarrayDesk.au3
#include<FileListToArray3.au3>
#include <File.au3>
#include <array.au3>
;~ #include <string.au3>
Local $Location = @DesktopDir & "\", $sFileResult = $Location & "All_Files.txt";to write
Local $sPath1 = @ScriptDir, $filter = "*.txt"; $filter = "*.txt" to get all text files in subdirs
Local $FileList = _FileListToArray3($sPath1, $filter, 1, 1, 1);,"",
;~ $FileList = _FileListToArray($Location) ; what are you trying to do with this line?
ConsoleWrite("Number of Files; $FileList[0]=" & $FileList[0] & @LF)
_ArrayDisplay($FileList, "$FileList")
Local $sClip = StringTrimRight(ClipGet(), 2)
ConsoleWrite("$sClip=" & $sClip & @LF)
Local $arClip = StringSplit($sClip, @CRLF, 1), $atmp
For $i = 1 To UBound($arClip) - 1
    ConsoleWrite("$arClip[$i]=" & $arClip[$i] & @LF)
    $atmp = StringSplit($arClip[$i], Chr(1))
    $arClip[$i] = $atmp[2]
    ConsoleWrite("$arClip[$i]=" & $arClip[$i] & @LF)
Next
_ArrayDisplay($arClip, "$arClip")
Exit
If $FileList[0] = 0 Then
    MsgBox(0, "", "No Files\Folders Found.")
    Exit
EndIf
$hOpener = FileOpen($sFileResult, 2)
For $X = 1 To UBound($FileList) - 1
    ToolTip("File #" & $X, 10, 10, "Tecter", 1)
    FileWrite($hOpener, FileRead($FileList[$X])); filelist alreasdy has base directory in string; $Location
    FileWrite($hOpener, @CRLF & @CRLF & "************* Divider **************** File Number = " & $X & @CRLF & @CRLF)
Next
FileClose($hOpener);

ShellExecute($Location & "All_Files.txt")
Posted (edited)

when i copy in directly it gives me this error:

>"C:\Programmer\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\Administrator\Skrivebord\randallnyeste.au3" /autoit3dir "C:\Programmer\AutoIt3" /UserParams 
+>01:52:36 Starting AutoIt3Wrapper v.1.9.4
>Running AU3Check (1.54.10.0)  from:C:\Programmer\AutoIt3
+>01:52:36 AU3Check ended.rc:0
>Running:(3.2.10.0):C:\Programmer\AutoIt3\autoit3.exe "C:\Documents and Settings\Administrator\Skrivebord\randallnyeste.au3"    
Number of Files; $FileList[0]=165
$sClip=[1]|C:\Documents and Settings\Administrator\Skrivebord\123hej\Ny Tekstdokument.txt
[2]|C:\Documents and Settings\Administrator\Skrivebord\123hej\Ny mappe\Ny Tekstdokument.tx
$arClip[$i]=[1]|C:\Documents and Settings\Administrator\Skrivebord\123hej\Ny Tekstdokument.txt
[2]|C:\Documents and Settings\Administrator\Skrivebord\123hej\Ny mappe\Ny Tekstdokument.tx
C:\Documents and Settings\Administrator\Skrivebord\randallnyeste.au3 (18) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: 
$arClip[$i] = $atmp[2] 
$arClip[$i] = ^ ERROR
->01:52:44 AutoIT3.exe ended.rc:1
+>01:52:45 AutoIt3Wrapper Finished
>Exit code: 1   Time: 9.668

Don't now why I marked two .txt files in the display, then I press textselected and close..

EDIT: as you can see it detects that I've marked the two files, but then an error comes up :/

Edited by newbiescripter
Posted

when i copy in directly it gives me this error:

Don't now why I marked two .txt files in the display, then I press textselected and close..

EDIT: as you can see it detects that I've marked the two files, but then an error comes up :/

hi,

Yes, I see you are not using beta;

Try this ; should work on either;

; filelisttoarrayDesk.au3
#include<FileListToArray3.au3>
#include <File.au3>
#include <array.au3>
;~ #include <string.au3>
Local $Location = @DesktopDir & "\", $sFileResult = $Location & "All_Files.txt";to write
Local $sPath1 = @ScriptDir, $filter = "*.txt"; $filter = "*.txt" to get all text files in subdirs
Local $FileList = _FileListToArray3($sPath1, $filter, 1, 1, 1);,"",
;~ $FileList = _FileListToArray($Location) ; what are you trying to do with this line?
ConsoleWrite("Number of Files; $FileList[0]=" & $FileList[0] & @LF)
ClipPut("")
_ArrayDisplay($FileList, "$FileList")
Local $sClip = StringTrimRight(StringStripCR(ClipGet()),1)
ConsoleWrite("$sClip=" & $sClip & @LF)
Local $arClip = StringSplit($sClip, @LF ), $atmp
local $sCharSplit=chr(1)
if @AutoItVersion=="3.2.10.0" then $sCharSplit="|"
For $i = 1 To UBound($arClip) - 1
    ConsoleWrite("$arClip[$i]=" & $arClip[$i] & @LF)
    $atmp = StringSplit($arClip[$i], $sCharSplit)
    if UBound($atmp)>2 then $arClip[$i] = $atmp[2]
    ConsoleWrite("$arClip[$i]=" & $arClip[$i] & @LF)
Next
_ArrayDisplay($arClip, "$arClip")
;~ Exit
If $FileList[0] = 0 Then
    MsgBox(0, "", "No Files\Folders Found.")
    Exit
EndIf
$hOpener = FileOpen($sFileResult, 2)
For $X = 1 To UBound($FileList) - 1
    ToolTip("File #" & $X, 10, 10, "Tecter", 1)
    FileWrite($hOpener, StringReplace(FileRead($FileList[$X]),chr(0),"")); filelist alreasdy has base directory in string; $Location
    FileWrite($hOpener, @CRLF & @CRLF & "************* Divider **************** File Number = " & $X & @CRLF & @CRLF)
Next
FileClose($hOpener);

ShellExecute($Location & "All_Files.txt")
Randall
Posted

Well now I've tried to install the beta version of autoit and when I beta run the last script you gave me it first pop ups with the $Filelist here i choose two files and then it pop ups with the two files only in @arClip and thats all fine, but when I then close the box again it's combining all the files from the $filelist and not the files from the $arClip :/

if it possible to make it take the files from arClip insted, then it's might working :)

Posted (edited)

Well now I've tried to install the beta version of autoit and when I beta run the last script you gave me it first pop ups with the $Filelist here i choose two files and then it pop ups with the two files only in @arClip and thats all fine, but when I then close the box again it's combining all the files from the $filelist and not the files from the $arClip :/

if it possible to make it take the files from arClip insted, then it's might working :)

Hi,

It seems you are having trouble with modifying scripts in even the simplest way at times?

oh well;

Try changing

For $X = 1 To UBound($FileList) - 1oÝ÷ ÚÚn­)ÞßF®¶­sdf÷"b33cµÒFòT&÷VæBb33c²b33c¶$6ÆÒ

Best, randall

[PS I thought I had made it now so it would work with production OR beta anyway...

Try this ; should work on either;

] Edited by randallc

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...