SPLITTING very large file

Discuss RoboTask here
Post Reply
ganapkg
Posts: 5
Joined: Thu Nov 16, 2006 5:41 pm

SPLITTING very large file

Post 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
Last edited by ganapkg on Sun Dec 17, 2006 12:31 am, edited 1 time in total.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

SPLITTING very large file

Post 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
Post Reply