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

Read from a textfile

Status
Not open for further replies.

lonchi

Programmer
Jan 30, 2002
12
MX
Hallo everyone,
I know this is possible with Crystal , but I don't
know how.
I need to do to read a specific *.text file and insert
some data in a database!

The text file will look like this:
===================================
Set:1
Name: My name
Adress: My adress
Street: My street
Zip: My Zip

Set:2
Name: My name
Adress: My adress
Street: My street
Zip: My Zip

Set:3
Name: My name
Adress: My adress
Street: My street
Zip: My Zip
.
.
.
.... and so on!
==================================

The trik is that I hace to use a text file.
Things like "dump it in excel " is not wat I want.

I hope you can help me.


Icheron..

 
The URL doesn't seem to work.
I can't get a DNS error.
 
Sorry, I ment, I get a DNS error.
 
Icheron,

you can use the MS text ODBC driver to read the file, however it will only have one field in it.

Please let me know if you have any questions. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Tanks for the reaction,

I'm tring this for a long time can you tell me what the exact steps are, because I seem to do something wrong.

If I get only one field, would it be all the information in the text file desplayed in one field?

Please let me know.
 
The info would be displayed in one column just like your post says. However there are workarunds to this.

Create fomula fields:

@name
if left({field},4)="name" then mid({field},6) else ""

Make similar formulas for all the fields you wish to display, and place them side by side horizontally in the details section. Insert a summary maximum by name for all of these fields, and then hide the details section. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
dgillz has the right idea, but I'd try heading upstream and getting the data source corrected first.

-kai
 
Bruce,

What does your UFL do that the MS .txt ODBC driver does not do? Please advise.

Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
The ODBC txt driver expects a text file with lots of lines, and a series of columns on each line. The columns look like fields, and the lines like records in a table. Every (or selected) lines are processed in the report.

My UFL is more like an Excel VLookup function. So it retrieves, searches and extracts only one selected value from the file. I've got one client where some additional information is required on the report, but it's not in the DB anywhere. So we are going to maintain a small txt file and look up the appropriate line with the UFL.

Also the two could work well in combination. Use the ODBC text driver to get the major data from a txt transaction file, and my UFL to lookup the customer names, product descriptions from other txt files.

The combination almost lets you use txt files as a relational DB with table joins. Editor and Publisher of Crystal Clear
 
Bruce,

How much is the UFL and do you have a demo I could download?

I have a perfect application for this UFL, see the thread I started on .pdf files. Most of what I have run into while searching for company lists are .txt files, vut my post was about one .pdf file I need to read exactly the way you describe here. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Icheron,
I'm not sure which version of crystal you are using, but as I recall.. Version 7 had a document import tool.. (think that was the name.. my memory gets fuzzy at times) which allowed you to set customizable fields from text documents.. which may work in this instance. Just offering other possibilities..
Cheers,
-Bruce Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
Bruce,
I'm using version 8 of Crystal reports.
I will check about that file import you told me about.

tanx,
Icheron
 
I think they discontinued the doc import tool after version 7 series.. :( Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
I think the document import tool is still available as a download but it was a strange beast.

The theory was that you had a txt file of an existing legacy report. You essentially coloured in parts of the report (Page headings, column headings, groups, fields, etc.) and then the wizard built an access MDB and a rpt to duplicate the report in CR. Then you point the rpt at the legacy data source and you've migrated your legacy report.

I found it faster to build a report from new as it was never a perfect fit Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top