Skip to main content

How to upload excel files to CDF files, I am looking for ways to upload files programatically and schedule this using cron expression.  

Hi @Rajendra Pasupuleti,

I'm going to go ahead and close this topic now, but please don't hesitate to reach out to us if you experience any further problems. We're always happy to help!

Best regards,
Dilini


Hi @Rajendra Pasupuleti,

Do you still experience this issue?

Best regards,
Dilini 


Answer provided by Andre Alves is very helpful. But while implementing the solution I am facing below error when I ran the code on CDF Jupyter notebook.  Will you be able to help me with this ? 

6 from cognite.client import CogniteClient      7 from cognite.client.data_classes import Row----> 8 from cognite.extractorutils import Extractor      9 from cognite.extractorutils.metrics import safe_get     10 from cognite.extractorutils.statestore import AbstractStateStoreModuleNotFoundError: No module named 'cognite.extractorutils'

 

When I ran the same code locally I am getting the below error. I tried different ways but couldn’t fix the error. It would be great help if you can help me fix this. 

 

             Traceback (most recent call last)Cell InC1], line 8      6 from cognite.client import CogniteClient      7 from cognite.client.data_classes import Row----> 8 from cognite.extractorutils.cogex import Extractor      9 from cognite.extractorutils.metrics import safe_get     10 from cognite.extractorutils.statestore import AbstractStateStoreImportError: cannot import name 'Extractor' from 'cognite.extractorutils.cogex' (C:\Users\DSCRP3\AppData\Local\anaconda3\Lib\site-packages\cognite\extractorutils\cogex\__init__.py)

Hi @Rajendra Pasupuleti,

We are following up to see whether you're satisfied with the responses you've received?

If you found the responses offered by our community members to be instructive and helpful, we kindly request that you consider marking the most helpful response as the "Best Answer.

Best regards,
Dilini


Hi @Rajendra Pasupuleti 

You can find an example of using the Cognite File Extractor for reading files in CSV format and uploading the content to CDF RAW at https://github.com/cognitedata/python-extractor-example.

Hope this helps!

André


Thanks for your response. I am new to CDF and I tried to find resources to implement cognite file extractor but I couldn’t find anything I can follow. Below is the one link I tried to follow but I am not sure how to proceed after dowloading the file_extractor_windows. 

https://docs.cognite.com/cdf/integration/guides/extraction/file/file_requirements


Hi, you can use the cognite file extractor to upload files to CDF on a schedule.


Reply