Jump to content

how to pic the characters not the numbers


rafu5418
 Share

Recommended Posts

Hi every one,

i am really new on this script programming.. . Actually i work in a office where my office colleagues give me some types of files like example: 'rafu7868.doc', 'lima23456.doc', 'pilu7862.doc'.. etc.. in a folder.

so, i just want to collect rafu documents not the others... each documents save the name and create random numbers at the end of the name...

i want a script that will collect the rafu documents and past it in the My Documents folder...

how i can do it.... please help me guys...

thank you

rafu

Link to comment
Share on other sites

#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir); change dir
If @Error=1 Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf


For $file In $FileList
    If StringInStr($file, "test") Then
;ConsoleWrite(@desktopdir & "\" & $file &@CR)
    FileCopy(@desktopdir & "\" & $file, @MyDocumentsDir)
    EndIf
Next

Edited by Pain
Link to comment
Share on other sites

go an look for FileFindFirst/FileFindNext functions, and just in case StringLeft and Random() in the helpfile

cheers

Edit: Pain beated me by a few seconds

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir); change dir
If @Error=1 Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf


For $file In $FileList
    If StringInStr($file, "test") Then
;ConsoleWrite(@desktopdir & "\" & $file &@CR)
    FileCopy(@desktopdir & "\" & $file, @MyDocumentsDir)
    EndIf
Next
thank you.... i got it... and i changes the Dir and it works.... it's copy automatically...

thank you [Pain] and [torels]

Edited by rafu5418
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...