Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Importing data...Help needed... (Read 2612 times)
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Importing data...Help needed...
Reply #15 - Jan 30th, 2007 at 10:29pm
Print Post Print Post  
Hello Cliff,

Give the following code a try.

Code
Select All
var fh1 as int
var fh2 as int
var fh3 as int
var fh_out as int
var done as int
var str1 as string
var str2 as string
var str3 as string
var str_out as string

	fh1 = fileOpen("book1.txt")
	fh2 = fileOpen("book2.txt")
	fh3 = fileOpen("book3.txt")

	fh_out = fileOpen("OutFile.txt")
	fileSeek(fh1, 0)
	fileSeek(fh2, 0)
	fileSeek(fh3, 0)
	fileSeek(fh_out, 0)

	done = 0
	While(done = 0)
	{
		If FilePos(fh1) <> FileSize(fh1) Then
		{
			fileReadln(fh1, str1)
		}
		Else
		{
			str1 = ""
		}
		If FilePos(fh2) <> FileSize(fh2) Then
		{
			fileReadln(fh2, str2)
		}
		Else
		{
			str2 = ""
		}
		If FilePos(fh3) <> FileSize(fh3) Then
		{
			fileReadln(fh3, str3)
		}
		Else
		{
			str3 = ""
		}

		If((@Len(str1) > 0) and (@Len(str2) > 0) and (@Len(str3) > 0))
		{
			str_out = str1 + ", " + str2 + ", " + str3
			fileWriteln(fh_out, str_out)
		}
		Else
		{
			done = 1
		}
	}
	fileClose(fh_out)
	fileClose(fh3)
	fileClose(fh2)
	fileClose(fh1) 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data...Help needed...
Reply #16 - Feb 16th, 2007 at 8:00pm
Print Post Print Post  
Hi Ray:

I want to thank you very much for helping me out.
I was able to develop my "outfile" this last Tuesday and have yet to try to import same into my test form.
However, base on my experience with the export I am betting that all will be fine.

I will update you with our success story.

Again...

Thanks!

Cliff
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print