Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-25-2009, 11:28 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Read Files in the order of creation date

I have a folder containing some sql files and I need to read these files one by one and add their content into a single file name update.sql
In order to achieve this I used a “Process files “ step which will find all the SQL scripts ,read them and write them into update.sql
I attached a sample of the project
Now a new requirement appeared –to read and write sql scripts in the order of creation date .
So based on file creation date –I need to take the oldest file and write it into update.sql ,then the next one created and so one.
I think the process file step take the files in random order ,is there any way to change that ?
Or how can I achieve such a thing to be done ?
Problem is when I look at the file properties –more relevant seems to me “Modified” section than “Created” section as it is older.
Thanks for any help
Attached Files
File Type: bld createupdatesql.bld (2.7 KB, 1832 views)
Reply With Quote
  #2  
Old 08-25-2009, 12:38 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
You would need to build up a list in the desired order and iterate over that with the Loop action.
Reply With Quote
  #3  
Old 08-27-2009, 07:02 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Ok,finally I am doing it this way -I create a text file containing the name of all the sql files ordered by last modification date ascending.Then i just read the text file line by line and write the content of every sql file into update.sql.
A sample of the project is attached,maybe someone else would need to sort files by date.
Attached Files
File Type: bld sortsqlfilesbydate.bld (5.4 KB, 1751 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 12:48 AM.


Copyright © 1999-2023 Kinook Software, Inc.