Solved

How to upload excel files to CDF files

  • 9 November 2023
  • 7 replies
  • 72 views

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

icon

Best answer by Dilini Fernando 30 November 2023, 09:37

View original

7 replies

Userlevel 2

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

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

Userlevel 3
Badge +5

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é

Userlevel 4
Badge +2

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

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 In[1], 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)
Userlevel 4
Badge +2

Hi @Rajendra Pasupuleti,

Do you still experience this issue?

Best regards,
Dilini 

Userlevel 4
Badge +2

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

Reply