Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Text file to table
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00919924
Message ID:
00919972
Vues:
8
James,

>I hope you can help.

It's easiest to help when you don't start two threads. *g*

>I have this text file with chapters in it going from chapter 1 to 25. I need to put this text file into a table. The fields i am using are chapter is numeric and the text part mneed to go into a memo field. Could some help me out with some code to work from..
* untested code that should get you started

create table TheBook ( iChapter i, mText m )

lcBook = filetostr( "TheBook.xt" )
lnChapter = 0
do while ! empty( lcBook )
   lnChapter = lnChapter + 1
   i = at( "Chapter ", lcBook, 2 )
   if ( i > 0 )
      lcChapter = left( lcBook, i-1 )
      lcBook = substr( lcBook, i )
   else
      lcChapter = lcBook
      lcBook = ""
   endif
   insert into TheBook values ( lnChapter, lcChapter )
enddo
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform