Community
cancel
Showing results for 
Search instead for 
Did you mean: 
LLim5
Novice
2,082 Views

How to access csv file from network share folder using Intel Edison.

Jump to solution

@I need to read the csv file from network share folder in Window by using Intel Edison board (Poky (Yocto Project Reference Distro) 1.7.3 piot005ai ttyMFD2), i686 GNU/Linux. I try to use the python code as below, but I get error.. I did change the '/' to '\', but same error resulted.

import csv

 

import os

x=os.listdir('////10.203.7.130//IoT//')

with open('////10.203.7.130//IoT//AlarmTrigger.csv', 'rb') as onOff:

 

reader = csv.reader(onOff)

 

for row in reader:

 

print row

 

onOff.close()

Error Message:

Traceback (most recent call last):

File "AlarmTrigger.py", line 4, in

x=os.listdir(''////10.203.7.130//IoT//')

OSError: [Errno 2] No such file or directory: ''////10.203.7.130//IoT//'

1 Solution
LLim5
Novice
89 Views

Thanks Sergio, Finally I manage to done it by using WinSCP - Keep remote directory up to date feature.

View solution in original post

6 Replies
idata
Community Manager
89 Views

Hi,

 

 

I ran the same code and received the same error as you. Can you share more information about your project? You just want to read the csv file? Have you already tried with these examples? http://www.pythonforbeginners.com/systems-programming/using-the-csv-module-in-python/ http://www.pythonforbeginners.com/systems-programming/using-the-csv-module-in-python/ . Use one of these templates but adapt them to the csv file location. Also, can you confirm the file location? According to your error this is the cause of your error. Are you trying to export the file from that IP address?

 

 

-Sergio

 

LLim5
Novice
89 Views

Thanks Sergio for your advice, I had try the example from the link you given. I can get the csv reading which store in local file, but when I try it for network share file, same error happened.

# !/usr/bin/env python

 

import csv

with open ('/tmp/AlarmTrigger.csv', 'rb') as onOff:

 

reader = csv.reader(onOff)

for row in reader:

 

print row

onOff.close()

The file is store in the share folder as below with ip address 10.203.7.130

The file is shared to everyone as below.

LLim5
Novice
89 Views

I am able to ping the ip address, but cannot access the IoT directory.

idata
Community Manager
89 Views

Can you go to the folder where AlarmTrigger.csv is stored in your Windows machine? I believe the problem is because of the path you're using. From the path of your first picture, navigate all the way until you see the.csv file and post a screenshot.

 

 

-Sergio

 

LLim5
Novice
89 Views

I am not able to open the folder. Do I need to install samba server for Intel Edison? But I cannot find a way to install in.

LLim5
Novice
90 Views

Thanks Sergio, Finally I manage to done it by using WinSCP - Keep remote directory up to date feature.

View solution in original post

Reply