title: Rearrange data using python
body: <p>SO following the question I asked before, (<a href="https://stackoverflow.com/questions/25042042/replacing-special-patterns-in-a-string-reading-from-a-file?noredirect=1#comment38981072_25042042">Replacing special patterns in a string, reading from a file</a>) I seemed to resolve the problem there. But now I'm pretty much stuck with this problem for a month. </p>
  
  <p>So with the code there , it reads the data from a file, parse it (so it divides the fields with tabs) but now I want the program to recognize the data ( so it needs to recognize in this example the authors, year of publication , isbn) and has to rearrange that data into a specific form/ pattern like for example:</p>
  
  <pre><code>INPUT DATA: Aubrecht, Christoph; Özceylan, Aubrecht Dilek; Klerx, Joachim; Freire, Sérgio (2013) “Future-oriented activities as a concept for improved disaster risk management. Disaster Advances”, 6(12), 1-10. (IF = 2.272) E-ISSN 2278-4543. REVISTA INDEXADA NO WEB OF SCIENCE 
  
  AUTHORS:Aubrecht, Christoph; Özceylan, Aubrecht Dilek; Klerx, Joachim; Freire, Sérgio
  YEAR: 2013
  ISBN: 2278-4543
  
  
  TEMPLATE 1: AUTHOR YEAR ISSN (Aubrecht, Christoph || 2013 || 2278-4543 )
  TEMPLATE 2: YEAR ISSN AUTHOR (2013 || 2278-4543 || Aubrecht, Christoph )
  TEMPLATE 3: ISSN YEAR AUTHOR (2278-4543 || 2013 || Aubrecht, Christoph )
  </code></pre>
  
  <p>The goal for this is to then import/export this data into Excel and then to a SQL database. I did my research and what I conclude (not sure if right) is that Django seems to be a good way to go since it can create templates (<a href="https://docs.djangoproject.com/en/dev/ref/templates/api/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/dev/ref/templates/api/</a>) or even with data frames using pandas dataframe  (<a href="https://stackoverflow.com/questions/22572326/how-to-rearrange-some-elements-as-a-data-frame">How to rearrange some elements as a data frame</a>, <a href="https://stackoverflow.com/questions/16839329/rearrange-data-for-pandas-dataframe">Rearrange data for pandas dataframe?</a>) , but I'm not sure how to implement both, or if its even the best way to do it ( or if it's even possible for a program to recognize those elements and rearrange them). </p>
  
  <p>Similar questions I've searched were: 
  <a href="https://stackoverflow.com/questions/2345628/using-a-key-to-rearrange-string">using a key to rearrange string</a>  (didn't help)
  <a href="https://stackoverflow.com/questions/21948685/rearranging-letters-from-a-list">Rearranging letters from a list</a> </p>