Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Need a format to write large .dat file with numbers


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-03-2008, 12:07 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 203
Default Need a format to write large .dat file with numbers

Hi,

I need the best format to write a large DAT file with numbers from a loop.

idea:

openfile of some sort
For c1 = 1 to x
For c2 = 1 to y
For c3 = 1 to z
Write (c1,c2,c3,c1*c2*c3) to a file in some number format
next
next
next
closefile of somesort


In other words which keywords do I use? FilePut, FileWite etc.
If anyone has an example I'd appreciate it very much....

thnx

Marc

Last edited by Stellaferox : 02-03-2008 at 12:08 PM. Reason: spelling
Reply With Quote
  #2 (permalink)  
Old 02-03-2008, 01:59 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 487
Awards Showcase
Beta Tester 
Total Awards: 1
Default

If it was me doing this then I'd put all the values into a table and simply save the table to CSV.
I would think that this would be faster than writing each value to the file separately.

Ragards,
randomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #3 (permalink)  
Old 02-03-2008, 02:08 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 203
Default

Yes, that would definitely be the best approach but I need 133784560 entries!
Reply With Quote
  #4 (permalink)  
Old 02-03-2008, 07:43 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

The best approach is to use a random access file.
Open the file with FileOpen(c,"filename",cRandom).
Now you have two options:
1. Use FileGet / FilePut and save the numbers as double type (8 bytes per number).
2. BETTER: Use BinaryFile to write and read the required types.
Reply With Quote
  #5 (permalink)  
Old 02-04-2008, 02:16 AM
Senior Member
 
Join Date: May 2007
Posts: 132
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi guys,
could be darn question...

If large data will be splited in two or more data files and then do some filters in opening a necessary file where to read particular data, is it an advantage in some way or not?

regards,
__________________
Rioven

Sony Ericsson XPERIA X1i WM6.1
480x800 Display Resolution
with QWERTY keyboard
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete and overwrite a write-protected file? Hertz Questions & Help Needed 4 07-25-2008 06:59 PM
Display large text file JamesC Questions & Help Needed 3 03-08-2008 03:45 AM
Struggling with the Icon File format. RandomCoder Questions & Help Needed 2 08-04-2007 08:05 PM
Large Txt or data file tcgoh Questions & Help Needed 4 05-29-2007 02:37 AM
Format of file "SQLDesktop.dll" is invalid. Peter Bug Reports 2 05-03-2007 11:58 AM


All times are GMT. The time now is 07:27 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0