![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Basic4ppc Wishlist Missing any feature? |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
We already have the ability to read text files (utf-8), and binary files...
Thoght binary files have positioning, its very dificult to know exactly were a datastream starts and ends, at least for me it is.. It would be of great help if we could read a specific line in a text file, something like FileReadLine(number) and of course to get the number of lines a text file contains... I know that, due to text wrapping, a file may apear to have more lines than it really has, so I'm aiming at the CHR(13) or crlf character as a end of line indicator...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
Asssuming a text file is not that big, say 20 lines of text, is it practical to read all lines, line-by-line, to an array?
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
But won't that eat up a lot of device resources?
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
|||
|
I'm still happy, if there is a function to readout or set the actual filepointer position.
My idea is, to scan a file (XML or whatever) one time sequentiel, find some keywords and save this to an array with the byteposition in the file. Then i can save this array to another indexfile and reread it on the next appl. start very quickly back in my array. If i need datas, i just search in the array the right keyword, readout the saved fileposition and move the filepointer to this position to readout all the detailed information in a very fast and easy way. In Visual Basic there is a function SEEK available to readout or set this position. http://msdn2.microsoft.com/en-us/lib...yt(VS.71).aspx Last edited by thedyg : 08-07-2007 at 11:55 AM. |
|
|||
|
Hi Dimitri,
you've right. But reading text in a byte per byte case normally is many slower then reading complete strings in one step. It is also possible to read in line by line and count the string length plus 2 bytes for crlf to a separate counter. I think, thats the right workaround at the moment for me. Here we are in the wishlist section It is just a wish of me to implement a function like seek in VB.B.t.w: I'm very surprised about this dev environnment. It is easy, fast and very small ( in a view to a dev Studio from Microsoft where you need DVDs to install it). Just after a quarter hour of testing, i purchased a version of b4ppc ! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading binary files | jgm | Questions & Help Needed | 5 | 05-28-2008 11:09 AM |
| reading and editing registry | Dr. Feelgood | Questions & Help Needed | 3 | 02-16-2008 08:18 AM |
| Problem beim Einlesen von Umlauten in Textfiles | mclane | German Forum | 2 | 12-08-2007 06:18 PM |
| Reading MP3 ID3 tags, any ideas??? | kronos79 | Forum Discussion | 2 | 11-10-2007 11:57 AM |
| Reading status of CTS | Paul | Questions & Help Needed | 2 | 06-19-2007 09:34 AM |