Message Boards Message Boards

Sort data in a specific way

Posted 10 years ago

Hi folks

I write because I have this problem, I start getting data from Wikipedia, to then try to get them in the following manner, the first year after the title and the other elements as a character, the producer left as they are,

filmorani = 
  Import["http://en.wikipedia.org/wiki/Rani_Mukerji_filmography", 
    "Data"][[1, 1, 2]];

Here I attempt to the order that I want to but does so only for the first two data from the list and the third in the forward left unchanged, I would like you to help me make the change to all so that it is on the order that I need

filmorani = 
 filmorani /. {a_, b_, c_, d_, e_, f_} -> {b, a, c, d, e, f}

thanks in advance!

POSTED BY: Luis Ledesma
3 Replies
Posted 10 years ago

Many thakns Girish Arabale for your help has helped me wonderfully, I hope to entertain me a good time with Bollywood.

POSTED BY: Luis Ledesma
Posted 10 years ago
Cases[filmorani, {a_, b_, c__} -> {b, a, c}]

Good luck for exploring Bollywood! :)

POSTED BY: Girish Arabale
Posted 10 years ago

It seems that all the elements of that list of lists do not have the same length, or because some elements if they change and others not

POSTED BY: Luis Ledesma
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract