Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with text file 2

Status
Not open for further replies.

EKC

Technical User
Jan 13, 2001
43
CA
Hi,
My select statement is:
Select field1,filed2 from Table1 to file Text1.txt

I have problem to parse this text file corectly in Excel sheet when field has more the one word with spaces, the whole thing is messed up then.(I use space as delimiter)
Is there any function that takes this spaces from (If field value is Ford Taurus 97 to be FordTaurus97) so I can include it in my select statement or any other idea will be welcome
Thanks in advance,
Lyn
 
1. MyMemVar = strtran(myMemVar , " ", "")

2. delimit the txt file with a comma and then import into Excel (Select field1,filed2 from Table1 to file Text1.txt delimited)

3. Use ODBC, ActiveX or Automation to place the infor directly into the Excel spreadsheet cells.

David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
I agree with dgrewe's solution using the STRTRAN function.


You could simply change your select statement to be:

SELECT STRTRAN(field1, " ", ""), STRTRAN(field2, " ", "") etc.


Jim
 
Lyn,

Have you researched the COPY TO function using the TYPE XLS argument? For example,

Select field1,filed2 from Table1 Into Cursor Temp
Copy To C:\MyFile.xls TYPE XLS Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top