Jump to content

Selecting a Folder and writing to Notepad


Recommended Posts

1. How to select a folder and then create a notepad, writing all the file names in a column

2. Creating a new folder with the same name.

3. Create new copies of a specific file equal to the number of names in the notepad

4. Renaming each of the files to the file names in the notepad

Link to comment
Share on other sites

1. How to select a folder and then create a notepad, writing all the file names in a column

Look at _FileListToArray to gather the file list.

Look at _FileWriteFromArray to save the file list.

2. Creating a new folder with the same name.

Look at DirCreate to create folders

3. Create new copies of a specific file equal to the number of names in the notepad

Look at FileCopy

4. Renaming each of the files to the file names in the notepad

Should be able to handle this step in the previous step, if not look at FileMove.

Link to comment
Share on other sites

So _FileListToArray

($sPath [, $Filter =*= [, $iFlag = 0 ]]) // What does it all mean? ( So does this select any folder or is it only bound to one path? ) And I'd be using $iFlag = 1, right?)

$Filter =*= remain as is?

What to put for $sPath ?

FileWriteFromArray

($File, $a_Array [, $i_Base = 0 [, $i_UBound = 0 [, $s_Delim= "|"]]]) // ( If I have the script in some folder, how do I get the notepad in the same folder )

// $File ( What would a folder in Cdrive/Desktop/ be? and $a_Array should I leave as is or do I need something there? $i_Base = 0 ( from top to bottom? ) $i_UBound = 0 as is?

$s_Delim as is ?

DirCreate

( "path" )

FileCopy

( "source", "dest" [, flag] )

//I need the below?

#include

#include

Link to comment
Share on other sites

Read the "HelpFile"

Example of what you can find, in the HelpFile:

_FileListToArray($sPath [, $sFilter = "*" [, $iFlag = 0]])

$sPath = Path to generate filelist for.
$sFilter = [optional] the filter to use, default is *. Search the AutoIt3 helpfile for the word "WildCards" for details.
$iFlag = [optional] specifies whether to return files, folders or both
          $iFlag=0 (Default) Return both files and folders
          $iFlag=1 Return files only
          $iFlag=2 Return Folders only

There's also a nice little example at the bottom of that HelpFile page where you can see how it is used.

#include <File.au3>
#include <Array.au3>

Local $FileList = _FileListToArray(@DesktopDir)
If @error = 1 Then
    MsgBox(0, "", "No Folders Found.")
    Exit
EndIf
If @error = 4 Then
    MsgBox(0, "", "No Files Found.")
    Exit
EndIf
_ArrayDisplay($FileList, "$FileList")

Other functions have the same stuff in the HelpFile.

The HelpFile will also note on whether there is a specific "#include" file that is required for it to function.

#include <File.au3>
_FileListToArray($sPath [, $sFilter = "*" [, $iFlag = 0]])

Again, read the HelpFile.

If you try to fail and succeed which have you done?AutoIt Forum Search

Link to comment
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
 Share

  • Recently Browsing   0 members

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