Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No documitaiton how to read a csv with a custom delimiter #75

Closed
guysoft opened this issue Feb 7, 2017 · 8 comments
Closed

No documitaiton how to read a csv with a custom delimiter #75

guysoft opened this issue Feb 7, 2017 · 8 comments

Comments

@guysoft
Copy link

guysoft commented Feb 7, 2017

Hey,
I want to read a csv that has tab as its delimiter.
I can't find anything in the documentation or code on how to force that.
Can you please explain what is missing to implement this/give a usage example?

Thanks,

@chfw
Copy link
Member

chfw commented Feb 7, 2017

please find it here. I will organise it later.

@guysoft
Copy link
Author

guysoft commented Feb 7, 2017 via email

@chfw
Copy link
Member

chfw commented Feb 7, 2017

My bad. Here is a read example:

>>> import pyexcel as p
>>> s=p.get_sheet(file_name='test.csv', delimiter='\t')
>>> s
test.csv:
+---+---+---+
| 1 | 2 | 3 |
+---+---+---+
| 4 | 5 | 6 |
+---+---+---+
>>> exit()
$ cat test.csv
1       2       3
4       5       6

@chfw chfw closed this as completed in 9852f0f Feb 8, 2017
@guysoft
Copy link
Author

guysoft commented Feb 8, 2017

Thanks!

@dimaninc
Copy link

@chfw hey man
i'm trying the code but it doesn't work:

Traceback (most recent call last):
  File "crawler.py", line 142, in <module>
    sheet = pyx.get_sheet(file_name=config['offersFolder'] + config['offersFilename'] + '.csv', delimeter=';')
...
File "/Users/dimaninc/Envs/t/lib/python3.6/site-packages/pyexcel_io/readers/csvr.py", line 151, in row_iterator
    return csv.reader(self.__file_handle, **self._keywords)
TypeError: 'delimeter' is an invalid keyword argument for this function

i've also searched for the keyword 'delimeter' in your sources but didnt find anything

@chfw
Copy link
Member

chfw commented May 14, 2018

@dimaninc
Copy link

@chfw oh thanks man, i'm an idiot :)

@chfw
Copy link
Member

chfw commented May 15, 2018

“To err is human, to forgive, divine.”

― Alexander Pope, An Essay on Criticism

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants