[AccessD] A2003: Merging top 50 files then next 50 files and soon

Darren D darren at activebilling.com.au
Mon Aug 4 23:17:15 CDT 2008


Hi Rocky and Stuart

Stuart I have copied and pasted the code below
Maybe air code but it's beyond my limited understanding :-)
I ran it and it errored I have forced it to resume on error
I can see an output file ending in 00 but I can't delete it whilst the dB is
open
I can also see an output file ending in 01 with some of the xml in it
What happens if there is more that 50 XML Should it create a new 02 file? 
Way beyond me - Sorry

Many many thanks

Darren

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Tuesday, 5 August 2008 11:35 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] A2003: Merging top 50 files then next 50 files and soon

Something like this? (Aircode so will probably need a fair of checking/cleaning
up)

Dim lngCounter as Long
Dim lngFileCounter as Long
Dim strFile as String
DIm strMergeFile as String

strMergeFile = "MergeFile01"
open strMergeFile for Output as #1
strFile = Dir$("*.*")
Do
	open strFile for Input as #2
	While not eof(2)
		line input #2, strtemp
		Print #1, strtemp
	Wend
	close #2
	lngCOunter = lngCounter + 1
           if lngCounter = 50 then
		lngFileCounter = lngFileCounter +1
           		lngCounter = 0
		close #1
		strMergeFile = "MergeFile" & Format(lngCounter,"00")
		open strMergeFile for Output as #1
           end if
          strFile = Dir$
Loop until strFile =""


On 5 Aug 2008 at 9:46, Darren D wrote:

> Hi Team
> 
>  
> 
> >From approx 5000 files I need to create approx 10 'blocks' of 50 files in
each
> block
> 
> I want to be able to get say the first 50 files in a folder - merging those 50
> files into one file 
> 
> Then getting the next 50 and merging that lot into a second merged file etc
and
> so on
> 
> I can do the merge bit OK 
> 
> Does anyone have a clue on how to get the first 50 then the next 50 and so on
> until all files have been merged into a handful of larger merged files?
> 
>  
> 
> FYI - they will all be individual XML files being merged into larger XML files
> to speed up internal processes here 
> 
>  
> 
> MTIA
> 
> 
> Darren
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list