Extension and naming of a file

Hi,

I have a List AvailableFileList which contains digital*.pdf,digital*.docx,digital*.csv, pricing*.pdf,pricing*.docx,pricing*.csv Files.
Now i have a directory which conatins many files around 1000 Files. i have to extract only those Files from here which has AvailableFileList strings i.e, anyfile which has written digital and either (.pdf/.docx /.csv.) or Pricing (.pdf/ .csv /.docx)
How can i do the same.
I have created a logic which is not working.

Hi @aamir,

I have not tried this using UiPath.
However, we can do following steps:

  1. window buton +R (Hotkeys)
  2. type “cmd” and enter (typeinto activity)
  3. type cd the directory path (typeinto activity)
  4. type “dir *.docx” (typeinto activity)
  5. the file will be listed having .docx extension (use scrapping to extract the required info or copy text)

Let me know if this helps.

Hi priyank,

Thanks for your help. I have created a workflow if you want i can send you what i have done is first it checks if that directory contains any .pdf,.csv,.docx file it sends to a temporary directory and then again i hv created a loop in which it is checking in that temporary directory any name with digital or pricing.
However i am able to move the files containing extension .pdf, .csv, .docx in temp directory but i am failing to move from temporary directory those files containing digital pricing.
Can you help me in this if i sent you my workflow.

Sure send the workflow. I will try my best to help you.

Main.xaml (49.9 KB)

and here i have used a .csv Files
which contains Columns 1.Contains Strings(values Digital,Pricing) and
2.Extensions(values .pdf,.csv,.docx)
3.SourcePath(" somepath") directory where all the files are stored in it.
4.Temporary Path("somepath ") directory where all files are getting stored here.

What is “y”
here
y < ContainsExtensionCounts

here y is a variable of int type contains value 0.

Basically, you are saying that the logic is working till you have the data in the temporary dir i.e. “D:\Backup Files”
Now after this you want to have separate dir for digital files and other for pricing files?

Yes.
from D directory now i want to move any file with a name digital or pricing to separate folder name digital and pricing.
Please help me in this i am not able to do it.

sure let me think on the logic …till then…
Can I suggest you to please try the below steps in uipath.

window buton +R (Hotkeys)
type “cmd” and enter (typeinto activity)
type “cd D:\Backup Files” (typeinto activity)
type “dir pricing*” (typeinto activity)
type “move pricing* D:\PricingFiles” (typeinto activity)

If this works for you.

Hi,

I tried the one which you said but unfortunately its not working

Hello @aamir
Sequence:Moving files back to source Drive – Activity:Move file
you are not passing the file name in destination field

Not working in the sense you are not able to achieve what you wanted to from the below logic.

As I have tried to simulate the steps in UiPath and is working perfectly fine. It is moving all file with the string like pricing is moving to destination dir.

window buton +R (Hotkeys)
type “cmd” and enter (typeinto activity)
type “cd D:\Backup Files” (typeinto activity)
type “dir pricing*” (typeinto activity)
type “move pricing* D:\PricingFiles” (typeinto activity)

the is working.
PFA the workflow.
Main.xaml (8.3 KB)

Hi,

I am passing it to destination field. i am attaching you the screenshot.

1 Like

use below it will work:

"C:\Users\aamir\Desktop\Updated Files\" & Path.GetFileName(File1.ToString)"

you are missing file name in destination field.

what are code for image extension . If a files having different folder with different files like images , PDF , txt, doc etc how we will copy the files having images to other folder. Please help .

How i can move various folder having image files with jscon to other folder can u please explain me or can give workflow of that.
I have a List AvailableFileList which contains digital*.pdf,digital*.docx,digital*.csv, pricing*.pdf,pricing*.docx,pricing*.csv Files specially Image files also with different extension.
Now i have a directory which conatins many files around 1000 Files. i have to extract only those Files from here which has image extension and .jscon files and move to other folder.
Can u please help me or give workflow of that.