[comp.sys.mac.hypercard] Importing Text ?????

fr0c+@andrew.cmu.edu (Frank A. Reynolds) (01/17/91)

Maybe someone can figure this one out. 

I'm importing text from a Microsoft Word document saved as text. It has
about 3000 names, and data on the names, with tabs between each item.  I
have only done importing of text to HyperCard as a test before, so I
stopped at about 1200 names to see if all the information was be
transfered into the right fields (there are 12 fields), everything was
fine.  So I opened the Word document and remove the names that had been
transfered then tried to import the rest.  HyperCard begins to import
the very 1st name again.

I have tried,

1.  re-saving the Word document, 
2.  re-named it,
3.  made a copy of the stack removed all the name already imported, 

and it still starts importing the 1st name again.

How can it import something that is not there ????????
What am I missing ?

The import script I am using is below.

on mouseUp
  Ask "Which file do you wish to import?" with "XYZportraits"
  if it is empty then exit mouseUp
  put it into fileName
  open file fileName
  go to last card
  repeat forever
    doMenu "New Card"
    read from file fileName until return
    if it is empty then
      go to first card
      close file fileName
      exit mouseUp
    else put tab into last char of it
    repeat with x=1 to the number of fields
      put char 1 to offset (tab,it) of it into field x
      delete last char of field x
      delete  char 1 to offset (tab,it) of it
    end repeat
  end repeat
end mouseUp

ollef@sics.se (Olle Furberg) (01/17/91)

In <4bZ8Mei00WBN821VtW@andrew.cmu.edu> fr0c+@andrew.cmu.edu (Frank A. Reynolds) writes:

>  So I opened the Word document and remove the names that had been
>transfered then tried to import the rest.  HyperCard begins to import
>the very 1st name again.


  Either the name is still in the file or it's gone. If it's gone, there is
no possibility for HyperCard to figure it out.

  Try to look at the file through another wordprocessor, is it really 
a plain text file?


    /Olle

austin@spies.sf-bay.org (Glenn Austin) (01/17/91)

In article <4bZ8Mei00WBN821VtW@andrew.cmu.edu> fr0c+@andrew.cmu.edu (Frank A. Reynolds) writes:
>Maybe someone can figure this one out. 
>
>I'm importing text from a Microsoft Word document saved as text. It has
>about 3000 names, and data on the names, with tabs between each item.  I
>have only done importing of text to HyperCard as a test before, so I
>stopped at about 1200 names to see if all the information was be
>transfered into the right fields (there are 12 fields), everything was
>fine.  So I opened the Word document and remove the names that had been
>transfered then tried to import the rest.  HyperCard begins to import
>the very 1st name again.
>
>I have tried,
>
>1.  re-saving the Word document, 
>2.  re-named it,
>3.  made a copy of the stack removed all the name already imported, 
>
>and it still starts importing the 1st name again.

That's because a document opened in Word is STILL OPEN EVEN THOUGH YOU'VE
CLOSED IT and remains open until you quit!  This is because (according to
Microsoft tech support) Word keeps track of clipboard selections as
pointers to within a document.

-- 
-----------------------------------------------------------------------------
| Glenn L. Austin               | "Turn too soon, run out of room,          | 
| Auto Racing Enthusiast and    |   Turn too late, much better fate"        |
|   Macintosh Wizard            |   - Jim Russell Racing School Instructors |