Title: Nested CSV
Last modified: January 7, 2022

---

# Nested CSV

 *  Resolved [Expire Posts](https://wordpress.org/support/users/expireposts/)
 * (@expireposts)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/nested-csv/)
 * I have a csv with a nested format. Basically it’s like this:
 * Row 1 has Col A populated. Rows 2-10 don’t have Col A populated and their information
   starts in Col B, yet the preceeding Col A is a value of each item.
 * Eventually Col A will get a new value which apply to the below rows.
 * This would be like Col A is the company and Col B is people’s names. All the 
   people whose names are in B1-B10 work for the company listed in A1.
 * Any way to apply the A1 value to the items in rows 1-10?
 * Thanks! [Appliance Team](https://appliance.report/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/nested-csv/#post-15246062)
 * Hi [@expireposts](https://wordpress.org/support/users/expireposts/),
 * > Any way to apply the A1 value to the items in rows 1-10?
 * You could do that with a custom PHP function: [https://www.wpallimport.com/documentation/developers/custom-code/inline-php/](https://www.wpallimport.com/documentation/developers/custom-code/inline-php/).
   The idea would be to pass the element from column A to the function like so:
 * `[my_get_company({company[1]})]`
 * See [https://d.pr/i/xDPZLE](https://d.pr/i/xDPZLE). The function can store the
   company name in an option and then only update that option when another company
   name shows up. You can then use our API ( [http://www.wpallimport.com/documentation/developers/action-reference/](http://www.wpallimport.com/documentation/developers/action-reference/))
   to erase the option at the end of the import. Here’s an untested example snippet
   that you can modify as needed: [https://d.pr/n/9nlIqm](https://d.pr/n/9nlIqm).
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/nested-csv/#post-15352876)
 * Hey [@expireposts](https://wordpress.org/support/users/expireposts/),
 * I’m marking this thread as resolved since it’s been inactive for a while now.
   Please feel free to open up a new topic if you still have questions.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Nested CSV’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

## Tags

 * [csv](https://wordpress.org/support/topic-tag/csv/)
 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [nesting](https://wordpress.org/support/topic-tag/nesting/)

 * 2 replies
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/nested-csv/#post-15352876)
 * Status: resolved