Answers.Body: <p>You can either use an url with https, http (e.g. <code>https://my.server.com/myfile.csv</code>) or use a local path (<code>/var/www/mycsv.csv</code>)</p>
  <p>For urls your server needs to be able to open URLs with <code>fopen</code>.</p>
  <p>The CSV data source uses the <code>fopen</code> function for reading the CSV file. More documentation on what kind of filenames can be used see <a href="https://www.php.net/manual/en/function.fopen.php" rel="nofollow noreferrer">https://www.php.net/manual/en/function.fopen.php</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-26T06:39:33.363Z
Answers.LastActivityDate: 2022-07-26T06:39:33.363Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>I was trying to use the CSV file as a datasource but couldn't find documentation on how to form the URI. Having the CSV file hosted and using the URL https://... to refer to the csv doesn't work as the field names remain empty. Also, if I were to host the CSV file on the CIVICRM server itself, how should the URI be formed ? Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-21T06:47:13.153Z
Comments.Text: Can you expand a little on what you are trying to do? I assume you are using the Data Processor extension? Do you want to import the file? Or just report on it?
Comments.UserDisplayName: ErikH - CiviCooP
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-22T04:22:34.427Z
Comments.Text: Thanks Erik.  The way I understand CSV File as the data source in DataProcessor is that a CSV file can be use as a lookup table to be joined with the other data sources.  So specifically here i should be able to output the corresponding value in the CSV file given the joined field e.g 879 to "Alor Star".  The problem I have is how to get data processor to consume the CSV file properly as i have tried the HTTPS way and the full path specification of the URI  ( to the CIVICRM temp file upload folder on the same server) and there was no available fields in the CSV file shown.  Thanks.
Comments.UserDisplayName: Clement Leong
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-26T06:01:35.963Z
Comments.Text: I am not an expert in the Data Processor but perhaps @Jaap Jansma can help you.....
Comments.UserDisplayName: ErikH - CiviCooP
Tags: <csv><data-processor>
Title: Using CSV file as datasource
ThreadText: # Using CSV file as datasource
  
  (Asked by: username_0 on 2022-07-21)
  
  I was trying to use the CSV file as a datasource but couldn't find documentation on how to form the URI. Having the CSV file hosted and using the URL https://... to refer to the csv doesn't work as the field names remain empty. Also, if I were to host the CSV file on the CIVICRM server itself, how should the URI be formed ? Thanks.
  
  **Tags:** csv, data-processor
  
  > **Comments:**
  > **username_1**: Can you expand a little on what you are trying to do? I assume you are using the Data Processor extension? Do you want to import the file? Or just report on it?  
  > **username_0**: Thanks Erik.  The way I understand CSV File as the data source in DataProcessor is that a CSV file can be use as a lookup table to be joined with the other data sources.  So specifically here i should be able to output the corresponding value in the CSV file given the joined field e.g 879 to "Alor Star".  The problem I have is how to get data processor to consume the CSV file properly as i have tried the HTTPS way and the full path specification of the URI  ( to the CIVICRM temp file upload folder on the same server) and there was no available fields in the CSV file shown.  Thanks.  
  > **username_1**: I am not an expert in the Data Processor but perhaps @username_2 Jansma can help you.....  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-07-26. Score: 1
  
  You can either use an url with https, http (e.g. `https://my.server.com/myfile.csv`) or use a local path (`/var/www/mycsv.csv`)
  
  For urls your server needs to be able to open URLs with `fopen`.
  
  The CSV data source uses the `fopen` function for reading the CSV file. More documentation on what kind of filenames can be used see <https://www.php.net/manual/en/function.fopen.php>
  
  
  ---
  
  