Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8307103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:27:43+00:00 2026-06-08T18:27:43+00:00

I export some of my db into a csv using PhpExcel. Because I have

  • 0

I export some of my db into a csv using PhpExcel.
Because I have quite some corrupted data, I check them and display the errors when necessary.

So I would like to display in my error message when a field contains my separator (otherwise it would mess with my pagination) :

$objWriter = PHPExcel_IOFactory::createWriter($this->_objErrorPHPExcel, 'CSV');
    $objWriter->setDelimiter('|');
    $objWriter->setEnclosure( '' );
    $objWriter->setUseBOM( true );
    $objWriter->setPreCalculateFormulas( false );
    $objWriter->save( $strOutputFile );
    unset( $objWriter );     

When I save my error message (for an email address like em|ail@email.com) :

$this->$strExcelFileName->getActiveSheet()->setCellValueExplicit('F' . $intRow, $strError );

Instead of saving in my F cell

EMail contains “|” character

I end up

EMail contains

in F, and

|

character in G.

I then have the same problem when I save the email in the spreadsheet, it is cut in 2 cells.

Thanks for your time and advices 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:27:44+00:00Added an answer on June 8, 2026 at 6:27 pm

    The solution was provided by DaveRandom ! :

    Well I’m fairly certain that your problem is going to be related to
    $objWriter->setEnclosure( ” ); – you are specifying an empty field
    enclosure, which means that there is no way to quote a string that
    contains a separator, so obviously it will be viewed as a field
    delimiter and not a literal character. I think you need to do
    something like $objWriter->setEnclosure( ‘”‘ );

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem: I have some Excel-sheets and must export them into
In my application iOS I need to export some data into CSV or HTML
I'm trying to export data from SQL Server into CSV format. I have a
I need to export some data from SAS to CSV, so that I can
I'm trying to use the primefaces dataExporter to export some data and I have
i need to export data from a table to a csv. i have the
I want to export some SQL Server 2005 data to CSV format (comma-separated with
I have a script to export data from MYSQL to a CSV file. the
I'm trying to export an Excel database into .txt (Tab Delimited), but some of
to export some data i want to be able to generate an html output.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.