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

Import fails if last field is empty #54

Open
apathyuk opened this issue Jun 4, 2014 · 2 comments
Open

Import fails if last field is empty #54

apathyuk opened this issue Jun 4, 2014 · 2 comments

Comments

@apathyuk
Copy link

apathyuk commented Jun 4, 2014

hello

Firstly ImportX saved me from having to manually add loads of data so the pain was worth it but what I found is if the last field can be blank in some records, then errors occur.

My hack solution was to move a field that always had a value to the end.

James


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Mark-H
Copy link
Member

Mark-H commented Jun 4, 2014

Hmmm I guess it probably complained about an incorrect number of fields in the row?

Right now the CSV parser is something custom built, but I am thinking of using something more robust that supports more CSV features in the future that should sort out stuff like this..

@apathyuk
Copy link
Author

apathyuk commented Jun 4, 2014

Yes, it complained about the number of fields.

I needed to import data compiled by a 3rd party in an Excel file and these are the steps (not including moving a field to the end of the table):

  1. Choose a deliminator and search the Excel file to make sure it is not being used. I used pipe in this case.
  2. Choose a temp comma replacement and search the Excel file to make sure it is not being used. I used hash in this case.
  3. Find for all double quotes and remove them from all cells
  4. Find all carriage returns within cells and replace with comma space (otherwise they appear on a new line in the CSV)
  5. Replace all commas with the temp comma replacement (#)
  6. Export to CSV
  7. Open in text edior
  8. Remove all double quotes (as otherwise ImportX will import them)
  9. Replace all commas with the new deliminator (I used pipe)
  10. Switch back the comma replacement with commas
  11. Remove the blank lines at the bottom

Its still far less effort than having to manually enter the data and deal with the data capture errors but it would be great if one could import an Excel file directly as this would remove the majority of the steps.

Kind regards

James

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

2 participants