I can convert an expression with the head of Times,for example, 12*12.5*13*13.5*14*14.5
to {12, 12.5, 13, 13.5, 14, 14.5}
by using the code below:
ReleaseHold[HoldForm[12*12.5*13*13.5*14*14.5] /. Times -> List]
I have a list which contains a lot of such expressions,here is an example:
listSample={12*12.5*13*13.5*14*14.5, 12*12.5*13*13.5*14*14.5,12*12.5*13*13.5*14*14.5, 12*12.5*13*13.5*14*14.5,12*12.5*13*13.5*14*14.5,12*12.5*13*13.5*14*14.5}
I still want to convert all the heads Times
to List
,but I failed when tried to Map HoldForm
to each listItem,because it alway evaluates first.
Here is my code:
ReleaseHold[HoldForm[#] /. Times -> List]&/@listSample
I want to get this result:
{{12, 12.5, 13, 13.5, 14, 14.5},{12, 12.5, 13, 13.5, 14, 14.5},{12, 12.5, 13, 13.5, 14, 14.5},{12, 12.5, 13, 13.5, 14, 14.5},{12, 12.5, 13, 13.5, 14, 14.5},{12, 12.5, 13, 13.5, 14, 14.5}}