benaw has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
Background: I have an excel spreadsheet and one of the columns has multiple values separated with a comma like an array. What I want to do is unwind the array so each value of the array is on a separate line and all other fields are duplicated or carried with it mongo documentation of $unwind does what I'd like or it may be a map reduce?
In the below example | is the delimiter in a CSV because I'm trying to target the commas in a particular cell and placing all the same text on each line. For example:
Source:
some text FOO | some text BAR | oh , no , commas | some text BAZ | some text QUXOutput:
some text FOO | some text BAR | oh | some text BAZ | some text QUX some text FOO | some text BAR | no | some text BAZ | some text QUX some text FOO | some text BAR |commas | some text BAZ | some text QUX
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: splinting a line of text by comma
by tybalt89 (Monsignor) on Nov 22, 2018 at 22:36 UTC | |
|
Re: splinting a line of text by comma
by tybalt89 (Monsignor) on Nov 22, 2018 at 22:47 UTC | |
by AnomalousMonk (Archbishop) on Nov 23, 2018 at 00:09 UTC | |
by tybalt89 (Monsignor) on Nov 23, 2018 at 02:14 UTC | |
by AnomalousMonk (Archbishop) on Nov 23, 2018 at 04:11 UTC | |
by poj (Abbot) on Nov 23, 2018 at 07:11 UTC | |
by tybalt89 (Monsignor) on Nov 23, 2018 at 04:30 UTC | |
|
Re: splinting a line of text by comma
by Tux (Canon) on Nov 23, 2018 at 07:57 UTC | |
|
Re: splinting a line of text by comma
by swl (Prior) on Nov 22, 2018 at 22:31 UTC | |
|
Re: splinting a line of text by comma
by stevieb (Canon) on Nov 22, 2018 at 22:18 UTC | |
|
Re: splinting a line of text by comma
by LanX (Saint) on Nov 23, 2018 at 03:00 UTC | |
by tybalt89 (Monsignor) on Nov 23, 2018 at 04:20 UTC | |
by LanX (Saint) on Nov 23, 2018 at 17:02 UTC | |
by tybalt89 (Monsignor) on Nov 26, 2018 at 15:22 UTC | |
by LanX (Saint) on Nov 26, 2018 at 15:27 UTC | |
|
Re: splinting a line of text by comma
by kcott (Archbishop) on Nov 23, 2018 at 08:16 UTC |