Activity question for digit change

Dear fellows,

Is there a method for auto changed digit ?
For example , a file is saved everyday with different file name like one day is 1…
the next day is 2… something like this.

Hi @PARK_Bin

1.Create an Asset in Orchestaror and give 1


2.Do your process and use FileName variable
3.Use Set Asset activity to increment the number

Regards,

Hi @PARK_Bin

You can try saving the days and flag values in a excel sheet like shown below , and for each day after file gets generated set the flag value of that particular day and the next day.

image

Write logic to only pick up the day with a particular flag value …

Hi @PARK_Bin,

This can be achieved by Determining the number of files present in the folder and Incrementing it by 1, This number can then be used to Name your file. To get the number of files present in a folder , you can use the Directory.GetFiles method, which returns an array of file paths. You can then use the .Length property to determine the number of files in that array.

Steps to Get the Number of Files in a Folder

  1. Use an Assign Activity:

    • Assign the array of files to a variable using Directory.GetFiles.
    filesArray = Directory.GetFiles("YourFolderPath")
    
  2. Get the Count of Files:

    • Use another Assign activity to get the count of files using the .Length property.
    fileCount = filesArray.Length
    
  3. Increment the fileCount:

  • Increment the fileCount by 1 to generate the Number

@PARK_Bin,

Follow this logic. It’s on text file.

FileNaming.zip (236.5 KB)

Thanks,
Ashok :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.