title: How can I delete all the columns in a csv file other than the ones I input?
body: <pre class="lang-py prettyprint-override"><code>all_filenames = [i for i in glob.glob("/home/greenvulcano/Scrivania/File_csv/*.csv")]
  dest_file = "/home/greenvulcano/Scrivania/Unione_files.csv"
  
  tag = ["inclination","deformation","temperature"]
  
  content = []
  for file_name in sorted(all_filenames):
      with open(file_name, "r") as f:
          lines = f.readlines()
      for i, l in enumerate(lines):
          if len(content) == 0:
              content.append(l)
          elif i != 0:
              content.append(l)
  
  
  with open(dest_file, "w") as f:
      f.writelines(content)    
  seleziona = input("Inserisci le colonne che vuoi visualizzare: ")    with open(dest_file, "r") as f:
      titoli = f.readline().split(",")
      indici = []
      for titolo in titoli:
          titolo_split = titolo.split('*')
          if seleziona in titolo_split:
              indice = titoli.index(titolo)
              indici.append(indice)
      righe = f.readlines()
      lista = []
      for riga in righe:
          rigasplit = riga.split(",")
          for i in indici:
              lista.append(rigasplit[i])
  </code></pre>