0

there are two files, old and new and those are dropped respectively to old and new folder via FTP Task .

i am bulkloading the file and do some calculation, and output file again need to drop in output folder

but how can i name the output file same as file came in old folder

suppose old folder contain file named as BigBoss, than output file named must be Bigboss_output.

Kindly help

1 Answers1

0

Have you tried to put a simple File.Copyin your script ?

In my project I have to copy some files and rename them after read all the folders and the files in them. Maybe this could help you.

Here my source code :

DirectoryInfo sourceFolder = new DirectoryInfo("\Path_of_my_source_folder\");
DirectoryInfo destination = new DirectoryInfo("\Destination_path\");

foreach (DirectoryInfo subFolder in sourceFolder.GetDirectories())
{
     foreach (FileInfo file in subFolder.GetFiles())
     {
          // [do all you want here]
          // Copy the file
          if (!File.Exists(destination + "\\" + file.Name + "_output"))
          {
               File.Copy(sourceFolder + "\\" + file.Name, destination + "\\" + file.Name + "_output");
           }

       }
}
Gardhak
  • 1
  • 5
  • Thanks Pal. but my scenario is little different. I have 10 customer who all are dropping their old and new file to a old and new folder respectively. my problem their output file should named or renamed to respective customername_output. Kindly suggest – Rajee Kasthuri Jan 21 '16 at 14:13