Page 1 of 1

SPLITTING very large file

Posted: Sat Dec 16, 2006 8:29 pm
by ganapkg
Hi,
 
I have a simple scenario. I will explain it step by step

I want to create a task which looks into a folder which contains many .csv files.
The task has to loop through all the files.
When it detects a .csv file which is 2400 KB it will split the file into two separate files. Each new file is 1200 KB each.
 
is this scenario possible?
 
Please help
 
Thank you

SPLITTING very large file

Posted: Mon Dec 18, 2006 12:09 pm
by Oleg
You can take as basis this example. This task splits CSV files by 30 lines.
You may make such changes
1. Increase the amount of lines from 30 to 3000 (for example). It depends on average length of string
2. Insert the checking of file size before splitting
See the following algorithm:
File loop
   if {FileSize({SOURCE_FILE})}>2400000 then
      ....
      split the file
      ....
   else
      copy file as is
   end if
end loop