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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Txt Delimited?

Status
Not open for further replies.

vino10

Programmer
Feb 8, 2004
30
PH
Guys,
Question guys, I have a system revision which includes all report form from Visual Foxpro reports to a Text delimited file. Any way of conerting it without starting from scratch? thanks in advance
 
If your existing report is based on a single cursor, table, view or select statement, it is not too hard.

Simply select the table (or whatever) then execute some code like this:

Code:
Select MyTable
copy to (m.MyOutPutFile) delimited

If you have memo fields in the output they will be ignored, dates will be exported in the current regional setting.

If it's more complex than that - doing look-ups etc or you need the memo fields - you will need to be a bit more sophisticated:

Code:
Select MyTable
go top
set alte to (m.MyOutPutFile)
set alte on
set console off
Do while .not. eof()
  ?? '"'
  ?? MyTextField
  ?? '",'
  ?? MyNumericField
  ?? ','
  ?? MyBooleanField
  ?
  Skip
Enddo
set alte off
set alte to
set console on

Gives you a general idea




Regards

Griff
Keep [Smile]ing
 
Tnx Yeah i think i can do that, the thing is the current report is generated from several variables like this:

Age
18-24 x1824
25-29 x2529
Total

where: x1824,x2529 is 2 unique variables then i use the command Report form "Report_name" to file "file_name" ascii.

Please tell me if i've done wrong,Please give me some tips to export the report form to a excel or a text delimited file. thanks a lot
 
Can you explain that again, I don't quite follow you?

Regards

Griff
Keep [Smile]ing
 
ok, sorry for that,Generally the report is for the breakdown count of each questions (Age breakdown,Do you smoke?, Etc) for a certain Survey Questionaire so i have put this report into a report form giving me the quick view and automation of report to print smoothly but i only did was to save it only to a word file(.doc) which the problem arises for sure you know when it come from report form then exporting it a word file the format to the word file if very bad, right now im printing the report then i manually encode the counts to another excel file. So our client request for automation of the report to excel file which i think it will take me 3 or 1 week to finished all the reports thats why i want to convert a report form(FRX) to an excel file. Hope you can see my point. how i wish i can show you the reports i want to export so you can easily understand what im saying. anyway im giving you again a sample which the report form(FRX) looks like.


Age breakdown
18_24 X1824 ---> a variable, handling the count
25_29 X2529 ---> a variable, handling the count
Total sum(x1824+x2529) sum of 2 variables

hope you can get my point.

 
Ah, I follow a BIT better now.

You could do the math as you process the table (using a variation on my plan B above) but this looks like the kind of think our MikeLewis is better at doing with a SQL statement - from which you could create a (plain) .xls file.



Regards

Griff
Keep [Smile]ing
 
Yap, i think i can use your codes but the problem is the codes aint simple enough and it has so many variation of reports to incorporate it. Im thinking of starting again from scratch by using SQL Statements in that way i can manipulate it mush more easier. I have some idea i dont know if it will work, do you think if i can use another software to that or a 3rd party it will do the work? if yes do you have a suggestion of what 3rd party?
 
I don't think any third party s/w is going to help you much - this looks like a knuckle down and do it job to me.

You could search Tek-Tips for Frx2Anything (or a variant on that) to see if there is anything suitable.

Regards

Griff
Keep [Smile]ing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top