New topic: 

Txt inport file problem

<http://forums.realsoftware.com/viewtopic.php?t=45779>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        Antonio          Post subject: Txt inport file problemPosted: 
Thu Nov 01, 2012 4:02 am                         
Joined: Sat Feb 04, 2012 1:26 pm
Posts: 17                Hi,
I have a txt file containing about 40,000 lines.
Each line is 100 characters long.
Each line contains several fields, but they are not comma nor tab nor space 
delimited. So the following fields: Name, Birthdate, country and town become 
inside my txt file as:
"000000mike19801231000Italy0000Rome”
Fields have fixed lenght so name field is 10 characters long, birthdate is 8 
long, country is 8 and so on. So i know where each fields begins and how long 
it is.
Now i wish to split the fields into a delimited file. But encountered a problem.
If i read the file line by line with 
Textinputstream.Open(f) and t.readline, it correctly shows me in the listbox  
the file content line by line as it is.
But If i read each line trying to split the fields into the listbox cells using 
mid(source, start, lenght) function, it doesn't work correctly and the lines 
content appear scrambled: First line does not appear at all, and the following 
lines appear with the fields scrambled, some lines are missed and so on.
Any help?   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to