-1

I used Laravel excel to generate a CSV file from arrays.

The CSV file has two rows:

Row 1 has 3 columns:

One | Two | Three

Row 2 has 4 columns

One | Two | Three | Four

Problem If I open the file generated using a text editor, the output I got for the two rows is as shown below:

“One”, ”Two”, “Three”, “”
“One”, ”Two”, “Three”, “Four”

I want something like this:

“One”, ”Two”, “Three”
“One”, ”Two”, “Three”, “Four”

Please do anyone knows how to remove the extra quotes(“”) I.e the extra column added to make the first row tally with the number of column in the second row.

Thank you.

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 25 '22 at 06:50

1 Answers1

0

I know that if I generate a CSV file it is certain that the number of columns for each row will be the same, it will adjust to the number of values(columns) we take from the rows. Although the data is null it will be included in 1 calculated column, I will explain again because each row will have the same number of columns. So the above wish, or another example like this:

"One", "Three", "Four"

"One", "Two", "Three", "Four"

I think it's impossible. CMIIW.

Hana Hasanah
  • 145
  • 1
  • 6