back to forum.

Topic: how to import data from a flat file

Topic by
sumagrawal

2011-03-17
03:50

how to import data from a flat file

Hi,

I have a problem; I am having 25 types of different flat file (extension .txt, .dat) with different types of data.

The files in their name have a time stamp and identifier. The files with same identifier are having same type of different data with no column name.

Can I make an analysis job with column names and keep on changing or importing more data in it.

Please help in this thanks

Reply by
kasper

2011-03-17
15:13
I'm not entirely sure I understand the situation, but it sounds like a perfect scenario to use the "open as template" functionality in DataCleaner.

What you can do is this: Create a job for a single of your files. Save it somewhere on disk. Bring op the "Open analysis job" file browser and select the job you just saved. But instead of just opening, select the "Open as template" button. This will bring up a dialog where you can map the original input of the job to a new input, eg. one of your other flat files.

Reply by
sumagrawal

2011-03-18
03:51
thanks for the guidance, will try to implement that and get back to you.

Reply by
sumagrawal

2011-03-18
04:31
hey it is working, i can map the tables well, but i can't see the column name in the analysis, it is displaying the first value in the column rather. s their any way to have name in display rather than the first values.

Reply by
kasper

2011-03-18
08:29
Right now the CSV parser will always assume that the first line in the file contains the column names. I think we might improve this in the future, but for now you will need to make sure that you have a headerline in each of the files.

Reply by
sumagrawal

2011-03-18
10:01
ya it can be, asking user about the choice for the name of column from the first row or the template.
thanks.....

Reply by
sumagrawal

2011-03-21
04:11
hey my map automatically function is not working and it is not mapping the column automatically, can you guide how to use it..

Reply by
kasper

2011-03-21
08:11
The "map automatically" button is just a simple aid for situations where you will have very similar looking datastores (eg. replicated, distributed or backed up data). In such cases the column names will be exactly the same, so the "Map automatically" button will simply look for column names in the new datastore that are the same as the column names in the original datastore. If not found, it will not do anything, which is probably what you're experiencing :)

If you have ideas on how to improve this though, I think it could be a nice way to get involved, because currently the code for doing the automatic mapping is very very simple.

Reply by
sumagrawal

2011-03-21
09:57
I made a template with the column names and saved it, then i open a file(tried both in .csv and .txt formats) with same column names and data types, even then it did not worked :( just thinking to automate the whole process.

You need to be logged in to participate

In order to post your own comments on this topic, you need to be logged in.

Username:

Log in by clicking the login link at the top of the screen

 

Go back to forum.