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

  • SEARCH
  • Home
  • 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 5839765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:38:02+00:00 2026-05-22T11:38:02+00:00

Suppose I have many objects, each has a UID property and an array of

  • 0

Suppose I have many objects, each has a UID property and an array of credit card NOs card_nos.

I want to dump the information to CVS(Excel) file in a fashion that cells with same UID are merged to form a single one. One UID spans as many rows as the number of credit cards it has, but at least one.

Here is an example, User 001 has 3 cards, so the cvs file will look like the following:

+-------------+
| UID | Card# |
--------------+
|     | Card1 |
      --------+
| 001 | Card2 |
      --------+
|     | Card3 |
--------------+

Any ideas? Thanks in advance.

  • 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-05-22T11:38:03+00:00Added an answer on May 22, 2026 at 11:38 am

    You can’t create a CSV file that does this – the CSV format doesn’t support it.

    Try it the other way and you’ll see: create a worksheet with the formatting as you describe and save it as CSV. You’ll get a warning starting with

    "[whatever you called it/] may contain features that are not compatible with CSV (Comma delimited)...."
    

    Accept the limitation and you’ll get a CSV file. Mine looked like this:

    UID,Card#
    001,Card1
    ,Card2
    ,Card3
    

    … which, when I reloaded it into Excel had indeed lost the merge as I expected:

    +------+-------+
    | UID  | Card# |
    +------+-------+
    | 1    | Card1 |
    +------+-------+
    |      | Card2 |
    +------+-------+
    |      | Card3 |
    +------+-------+
    

    You can, however, get there with HTML, if it makes sense otherwise in your app – the following HTML will load with a merged UID cell as described (note the use of the “rowspan” attribute):

    <table>
      <thead>
        <tr>
          <td>UID</td>
          <td>Card#</td>
        </tr>
      </thead>
      <tbody>
          <tr>
            <td rowspan="3">001</td>
            <td>Card1</td>
          </tr>
          <tr>
            <td>Card2</td>
          </tr>
          <tr>
            <td>Card3</td>
          </tr>
      </tbody>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose we have to create many small objects of byte array type. The size
Suppose you have 2 UISwitch objects placed onto your storyboard. Each of them can
Suppose I create collection like Collection<IMyType> coll; Then I have many implelentations of IMyTypem
suppose I have a class with many explicit (statically allocated) members and few pointers
Suppose I have a table called Companies that has a DepartmentID column. There's also
I have a core data entity which has an exclusive one to many relationship
I have a model Client which has many :tours, association in it. I am
Suppose I have such requirement: The objects in the system all derive from a
In Python, I have a Graph class that has a dictionary of vertex objects.
Suppose I have an object with many members: class Example { AnotherClass member1; AnotherClass

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.