I am still a beginner with Mathematica and I have a simple problem with splitting this list:
List1 = {"Id=\"1\"", "PostTypeId=\"1\"", "AcceptedAnswerId=\"2\"", \
"CreationDate=\"2013-11-05T20:22:07.323\"", "OwnerUserId=\"8\"", \
"LastEditorUserId=\"8\"", "Tags=\"<word-choice><articles>\
\"", "Id=\"2\"", "PostTypeId=\"2\"", "ParentId=\"1\"", "CreationDate=\
\"2013-11-05T20:36:02.473\"", "OwnerUserId=\"17\"", \
"LastEditorUserId=\"17\"", "Id=\"3\"", "PostTypeId=\"2\"", "ParentId=\
\"1\"", "CreationDate=\"2013-11-05T20:37:28.327\"", \
"OwnerUserId=\"6\"", "Id=\"4\"", "PostTypeId=\"2\"", \
"ParentId=\"1\"", "CreationDate=\"2013-11-05T20:38:07.760\"", \
"OwnerUserId=\"18\"", "LastEditorUserId=\"8\"", "Id=\"5\"", \
"PostTypeId=\"1\"", "CreationDate=\"2013-11-05T20:46:59.993\"", \
"OwnerUserId=\"18\"", "LastEditorUserId=\"707\"", \
"Tags=\"<etymology><proverbs>\"", "Id=\"6\"", \
"PostTypeId=\"1\"", "AcceptedAnswerId=\"8\"", \
"CreationDate=\"2013-11-05T21:01:56.857\"", "OwnerUserId=\"18\"", \
"LastEditorUserId=\"707\"", \
"Tags=\"<grammar><grammatical-number>\"", "Id=\"8\"", \
"PostTypeId=\"2\"", "ParentId=\"6\"", \
"CreationDate=\"2013-11-05T21:09:18.067\"", "OwnerUserId=\"6\"", \
"LastEditorUserId=\"1243\"", "Id=\"9\"", "PostTypeId=\"2\"", \
"ParentId=\"6\"", "CreationDate=\"2013-11-05T21:15:24.207\"", \
"OwnerUserId=\"22\"", "LastEditorUserId=\"57\"", "Id=\"10\""}
What I would like to do is divide the list in such a way that I have a lists with only: List1 = {{Id1, CreationDate1, Tags1},{Id2, CreationDate2, Tags2},{Id3, CreationDate3, Tags3}...}.
The approach I tried is to split on the >\"
. Unfortunately this doesn't work. Can someone help me in finding a quick way to do it? (as plus, it would nice if we could get rid of &alt;
and >
in somehow)
I hereby post the code I used
StringSplit[StringJoin[{List1}], ">\""]
But it doesn't help a lot, since then I have to get back then to the original list with another StringSplit. I am sure there is a smarter way I am not able to see here.
Thanks a lot in advance!
Partition[List1,3]
$\endgroup$StringSplit
only works on strings, not lists. $\endgroup$