How to upload excel files to CDF files, I am looking for ways to upload files programatically and schedule this using cron expression.
Best answer by Dilini Fernando 30 November 2023, 09:37
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.
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!
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.
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, 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)
Do you still experience this issue?
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!
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.