I have a text file with e-mail addresses seperated by Return key
(chr13). I need to import the e-mail addresses into a table. To do
this, I created a table with one C(100) field and was able to execute:
append from textfile.txt type SDF with VFP6.0. All data got imported
ok. However, when I do the same command in VFP9.0, all e-mail address
in the table displayed as a square box - unrecognized character. What
did I do wrong?

-jesk

Re: Read from text file by Stefan

Stefan
Mon Feb 06 02:28:17 CST 2006


"jesk" <coocoonut@hotmail.com> schrieb im Newsbeitrag
news:1139213212.755499.156110@g43g2000cwa.googlegroups.com...
>I have a text file with e-mail addresses seperated by Return key
> (chr13). I need to import the e-mail addresses into a table. To do
> this, I created a table with one C(100) field and was able to execute:
> append from textfile.txt type SDF with VFP6.0. All data got imported
> ok. However, when I do the same command in VFP9.0, all e-mail address
> in the table displayed as a square box - unrecognized character. What
> did I do wrong?

You can use an Editbox control to display a multiple-lines string
instead of a Textbox.
(I have no VFP6 here to test the effect, but VFP7 shows the
same behavior for me as VFP9 does in a standard Browse.)


hth
-Stefan



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------



Re: Read from text file by Cindy

Cindy
Mon Feb 06 10:07:58 CST 2006

Hi Jesk,

The following worked just fine for me. How is it different from what you
have?

StrToFile("cindy_winegarden@msn.com" + Chr(13) + ;
"cindy_winegarden@hotmail.com" + Chr(13) + ;
"cindy_winegarden@aol.com" + Chr(13), ;
"C:\Temp\TestEmail.txt")
Create Cursor Test (Field1 C(100))
Append From "C:\Temp\TestEmail.txt" Type SDF
Browse

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


"jesk" <coocoonut@hotmail.com> wrote in message
news:1139213212.755499.156110@g43g2000cwa.googlegroups.com...
>I have a text file with e-mail addresses seperated by Return key
> (chr13). I need to import the e-mail addresses into a table. To do
> this, I created a table with one C(100) field and was able to execute:
> append from textfile.txt type SDF with VFP6.0. All data got imported
> ok. However, when I do the same command in VFP9.0, all e-mail address
> in the table displayed as a square box - unrecognized character. What
> did I do wrong?
>
> -jesk
>



Re: Read from text file by jesk

jesk
Tue Feb 07 01:42:29 CST 2006

Hi Cindy,

Thank you for your sample code. That work just fine for me. However
the .txt file I have looks normal in both notepad and wordpad. No
strange characters, but the outcome don't look normal.

I did a test with your code to my .txt file:
Create Cursor Test (Field1 C(100))
Append From "C:\Temp\EmailList.txt" Type SDF
Browse

What I see in notepad like "abc@xyz.com". After excuting the code
above, this shows in the browse window: "?a?b?c?@?x?y?z?.?c?o?m?".
Each ? is a small square box. Are there possible hidden characters in
the .txt file? Can I send you a small sample .txt file to check?

Thanks,
-jesk


Re: Read from text file by Andrew

Andrew
Tue Feb 07 02:21:26 CST 2006

"jesk" <coocoonut@hotmail.com> wrote in message
news:1139298149.740178.165230@o13g2000cwo.googlegroups.com...
> Hi Cindy,
>
> Thank you for your sample code. That work just fine for me. However
> the .txt file I have looks normal in both notepad and wordpad. No
> strange characters, but the outcome don't look normal.
>
> I did a test with your code to my .txt file:
> Create Cursor Test (Field1 C(100))
> Append From "C:\Temp\EmailList.txt" Type SDF
> Browse
>
> What I see in notepad like "abc@xyz.com". After excuting the code
> above, this shows in the browse window: "?a?b?c?@?x?y?z?.?c?o?m?".
> Each ? is a small square box. Are there possible hidden characters in
> the .txt file? Can I send you a small sample .txt file to check?

This sounds like a unicode ish issue.
Amazingly VFP is still remarkably unable to deal with unicode data. It's
very backward in that sense. Try opening in wordpad and saving as a separate
file. Use the "Text Document" option in the "Save as type" box.

--
HTH
Andrew Howell



Re: Read from text file by jesk

jesk
Tue Feb 07 16:11:12 CST 2006

That's it Andrew! That fixed my problem :)
When I click Save As, it prompts as "Unicode Text Document". Saving it
as Text Document solves the problem.

Thank you all!
-jesk