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

How to extract data from a flat file.

Status
Not open for further replies.

Macho123

Technical User
Oct 20, 2007
62
US
I have a flat file and i need the report to get data from the flat file. Actually I set the date source to the flat file under Access/Excel in data source but it is not fetching me the data in to the report. in the report it shows only the database in the field explorer and under that there are no fileds from where i could choose them in to the report.
 
By flat file I assume you mean text with each record in a separate line?

If so does the first line in the file contain the field names? And how is the file delimited?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Actually it is not a txt file it is dat file and i do not know what should i choose in the crystal to recognise the data in that file. the data is delimited by ; and there are no column headings in the file. once again it is DAT file.

please help me in this.

Thanks,
krant.
 
Any Suggestions please. I am getting the data in to the report but it is not at all clear I am getting entire things as a row insted of different columns of a row. Help me out with this.

Thanks,
krant.
 
No replies please help me with this.

Thanks...
 
I do not know how to access such a file without column headings. The lack of response on your thread probably means no one else knows either.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Ok if there are column heading then how would i do that. tell me that so that i can ask the user to provide me with the column headings.

Thanks...
 
Create an ODBC connection to the file using a .txt driver.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Thanks I did the same but when I set every thing and say OK it says some problem with the column null values, so then I changed all the null values in the text value to n/a even then it gives the same message. Please help me on this.

Thanks...
 
Does the file now have column headings?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Can you find out from the user what program this was made in origianlly?

.dat could be anything. It sounds like this is semicolon separation but even then it could be anything from some very common piece of software to a very closely guarded secret file type.
 
Thanks for the reply.

this is written in java. DAT file is not allowing me to connect to crystal it says read only and for this I have converted the dat file to txt file and then tried to connect it directly to the crytsal by the access/excel source and by doing this i could populate the data but it is not in order and because there are no column names i could not fid it make out from the data. When i am trying to create a odbc driver for this text file to make sure that all the columns are populated as they are in the txt file and when i am trying to connect it to the crystal it says some error. " database connection error the txt file col is not specific". Please help me out with this.

Please help me.

THanks...

 
help please. when i try to create adsn for the flat file it says "failed to save table attributes of (null) in to (null).

help with this please. how to make this work.

Thnaks...
 
Krant,

You need better understanding or control over how this file is created to do this. Can you open the file with notepad? If so, then it is definately a text file. Does it have column headings? If not, can you get the develop or application that created the file to place the column headings in there?

Without the column headings, you are in trouble, IMHO.

Finally, stop begging for an answer. You have had lots of help already. The lack of acceptable responses is because of your lack of supplying data, not because anyone is ignoring you.


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Yes i have converted it in to a text file and i have to extract data from the text file and i got the column names from the developers and i do have the column names with me what are being used but they are not in the text file. I can put them in the text file manually. but after that what do i do.

sorry if have irritated you but in the beginning even i did not have clear requirement.

Thanks...
 
Create an ODBC DSN that points to the file with the column names. Use a text driver. Have you done this yet? This was several posts ago.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Hi Just ignore this because, the flat file has four different records as one set and in that manner it has several sets and when i create the odbc driver because the columns are not same in all the four records i am getting an error saying 'can not copy values from null to null'. And out of the four records in a set I need only one record. for example.

record1
record2
record3
record4
record5
record6
record7
record8

In the above data record 1 and 5 are of same columns and same data type and then 2 and 6, 3 and 7, 4 and 8 are same. Ineed only those records of type 3 and 7 and 11. Is there any way to do this.

Thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top