Skip to content

Instantly share code, notes, and snippets.

@elanozturk
Created February 23, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elanozturk/bc6486dad6de03d2b5e1af0efbacd0e4 to your computer and use it in GitHub Desktop.
Save elanozturk/bc6486dad6de03d2b5e1af0efbacd0e4 to your computer and use it in GitHub Desktop.
import os
import time
print('removing old url.xlsx file')
time.sleep(1)
os.system("rm /root/Desktop/Docs/linux/url.xlsx >/dev/null 2>&1")
print('downloading new url.txt file from github')
os.system("cd /root/Desktop/Docs/linux/ && wget https://raw.githubusercontent.com/elanozturk/personal-backup/master/elan.txt >/dev/null 2>&1")
time.sleep(1)
os.system("sed 's/ \+/,/g' /root/Desktop/Docs/linux/elan.txt > /root/Desktop/Docs/linux/url.csv")
print('current song url :')
os.system("cat /root/Desktop/Docs/linux/url.csv | lolcat")
time.sleep(2)
print('converting url.txt file to url.xlsx file')
os.system("libreoffice --headless --convert-to xlsx /root/Desktop/Docs/linux/url.csv > /dev/null 2>&1")
time.sleep(2)
os.system("rm /root/Desktop/Docs/linux/elan.txt /root/Desktop/Docs/linux/url.csv >/dev/null 2>&1")
os.system("echo 'url.xls file is ready' | lolcat")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment