1

As I am using React in ES6 and am using Jquery-CSV library, I was unable to import using

var $ = jQuery = require('jquery');
require('./jquery.csv.js');

Found a way to import using

import * as randomName from 'jquery-csv'

Now how am I able to use

$.csv.toArrays(csv);```/```$.csv.toObjects(csv);?

I tried to play around by using names as prefix like randomName.csv.toArrays() but no luck.

EDIT:


randomName.toArray(csv); this works,

but now I am getting the following error

TypeError: csv.replace is not a function

How to solve this?

2 Answers 2

1

Able to access the library and while passing string as input, I am able to get the them in Array.

input="This is a Random string"

randomName.csv.toArray(input)

Output: ["This is a Random string"]

Sign up to request clarification or add additional context in comments.

Comments

0

Same result here using React

import $ from 'jquery'
var csv  = $.csv = require('jquery-csv');
var input="This is a Random string"
tableau_d = csv.toArray(input)
alert(tableau_d)

Output : "This is a Random string"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.