ios-personmd-notifications md-help-circle

Profile

  • Guest
    medal 0
  • Posts: 21
  • Post Likes: 3765

Notifications

  • No Unread Notifications

Solved
about CSV

ios-checkmark-circle
This thread is closed because it is solved.
angle-double-left ios-arrow-back 1 ios-arrow-forward angle-double-right
medal 5851
2 years 275 days ago
I want you to separate the driver name and team name in the race result exported by CSV.
md-quotelink
medal 5966 Moderator
2 years 275 days ago (Last edited by M. Truche 2 years 274 days ago)
Hi Makoto,

Just a copy/paste of a tip I had posted on the forum. Maybe not the perfect solution, but it works.

Don't know if it can help you, but here a small trick to split drivers / teams to download a well formated CSV.


  1. In your web browser, create a new bookmark (favorite)

  2. Fill the address/URL field of this bookmark with the snippet of Javascript (see below)

  3. To use it, go on the race result and open your bookmark (the table will be update and you can use the Export CSV button)



Javascript function (last update 20/07 20h05) :
javascript:(function()%7Bvar%20k=document.getElementById("csvRace");fix=$(k).html().replace(/<br>/g,'<td>').trim();$(k).html(fix);hder=k.getElementsByTagName('th')[1];hder.insertAdjacentHTML('afterend','<th>Team</th>');document.getElementsByClassName("gold")[0].textContent=1;document.getElementsByClassName("silver")[0].textContent=2;document.getElementsByClassName("bronze")[0].textContent=3;%7D)();



Example :

600x400

md-quotelink
medal 5851
2 years 274 days ago
I tried this on Chrome for Mac but it didn't work.
md-quotelink
medal 5000
2 years 274 days ago
This would be useful but I can't get it to work, I am using office 2019. Not sure I follow you on the bookmark part.
md-quotelink
medal 5047
2 years 274 days ago
Archibald
This would be useful but I can't get it to work, I am using office 2019. Not sure I follow you on the bookmark part.

That is done in the web browser, not in Office.


Paste the following in the search bar:

javascript:(function()%7Bvar%20k=document.getElementById("csvRace");fix=$(k).html().replace(/ /g,',').replace(/<br>/g,'<td>').trim();$(k).html(fix);hder=k.getElementsByTagName('th')[1];hder.insertAdjacentHTML('afterend','<th>Team</th>');document.getElementsByClassName("gold")[0].textContent=1;document.getElementsByClassName("silver")[0].textContent=2;document.getElementsByClassName("bronze")[0].textContent=3;%7D)();


md-quotelink
medal 5000
2 years 274 days ago
Still no luck never mind. Thanks for the effort though.
md-quotelink
medal 5966 Moderator
2 years 274 days ago
Makoto
I tried this on Chrome for Mac but it didn't work.


My bad, I did not see the HTML table had changed. I have updated the Javascript function to solve the issue.


Let's try to explain how to use it :


  • Firefox



  1. Open Firefox

  2. Ctrl B (to open bookmarks view)

  3. Right click

  4. Add a bookmark

  5. Name : iGP CSV (does not matter)

  6. URL : copy/paste the javascript function posted below

  7. Save




  • Chrome



  1. Open Chrome

  2. Ctrl Shift O (to open bookmarks view)

  3. Right click

  4. Add new bookmark

  5. Name : iGP CSV (does not matter)

  6. URL: copy/paste the javascript function posted below

  7. Save



New Javascript function :
javascript:(function()%7Bvar%20k=document.getElementById("csvRace");fix=$(k).html().replace(/<br>/g,'<td>').trim();$(k).html(fix);hder=k.getElementsByTagName('th')[1];hder.insertAdjacentHTML('afterend','<th>Team</th>');document.getElementsByClassName("gold")[0].textContent=1;document.getElementsByClassName("silver")[0].textContent=2;document.getElementsByClassName("bronze")[0].textContent=3;%7D)();



Now, go to the results page you wanted to dowload as CSV.
Click on the "iGP CSV" bookmark. A new column with team name should be visible in the table.
Download CSV file as usual.
md-quotelink
medal 5000
2 years 274 days ago
Now working fine, good job. Thanks
md-quotelink
medal 5851
2 years 274 days ago
I did it well! This is useful! Thank you very much!
md-quotelink
angle-double-left ios-arrow-back 1 ios-arrow-forward angle-double-right

You must be logged in to post a reply.