title: Convert .skeleton file to .csv file with python
body: <p>I am going to take from a dataset called the NTURGBD- dataset some specific skeleton files copy them to a new folder and then convert them to csv ones.I cant find a way to make it work. Right now the code below gives me an error:</p>
  <pre><code>line 75, in os.rename(os.path.join(path, file), ValueError: rename: dst too long for Windows
  </code></pre>
  <p>Anyone know how to solve it?</p>
  <pre class="lang-py prettyprint-override"><code>import os,shutil
  import os.path
  from os import path
  import csv
  from pathlib import Path
  
  fileNamesF = []
  
  # Path of skeleton files &amp;&amp; Path of the new skeleton.csv files
  original_skeleton_location = 'C:\\Users\\Apostolos\\Documents\\Programming Folders\\Ptixiaki\\skeletons\\nturgbS01-17-skeletons'
  base_directory = 'C:\\Users\\Apostolos\\Documents\\Programming Folders\\Ptixiaki\\skeletons\\csvSkeletons'
  
  # Check and create path for the new csv files 
  if not os.path.exists('C:\\Users\\Apostolos\\Documents\\Programming Folders\\Ptixiaki\\skeletons\\csvSkeletons'):
      os.mkdir(base_directory)
  
  # Check and create path for healthAction files
  healthActions_directory = os.path.join(base_directory,'healthActions')
  if not os.path.exists(healthActions_directory):
      os.mkdir(healthActions_directory)
  
  # copy files to healthActions directory
  def copyFiles():
      for fileName in fileNames:
          try:
              source = os.path.join(original_skeleton_location, fileName)
              dest = os.path.join(healthActions_directory, fileName)
              shutil.copyfile(source, dest)
          except OSError:
              pass
  
  # copy skeleton files to a new destination
  fileNames = ['S00{}C00{}P00{}R00{}A0{}.skeleton'.format(s,c,p,r,a)
      for s in range(1,10,2)
      for c in range(1,4)
      for p in range(1,9)
      for r in range(1,3) 
      for a in range(41,50)]
  fileNamesF.append(fileNames)
  copyFiles()
  
  fileNames = ['S0{}C00{}P00{}R00{}A0{}.skeleton'.format(s, c, p, r, a)
               for s in range(11,18, 2)
               for c in range(1, 4)
               for p in range(1, 9)
               for r in range(1, 3)
               for a in range(41, 50)]
  fileNamesF.append(fileNames)
  copyFiles()
  
  fileNames = ['S00{}C00{}P0{}R00{}A0{}.skeleton'.format(s, c, p, r, a)
               for s in range(1, 10, 2)
               for c in range(1, 4)
               for p in range(10, 40)
               for r in range(1, 3)
               for a in range(41, 50)]
  fileNamesF.append(fileNames)
  copyFiles()
  
  fileNames = ['S0{}C00{}P0{}R00{}A0{}.skeleton'.format(s, c, p, r, a)
               for s in range(11, 18, 2)
               for c in range(1, 4)
               for p in range(10,40)
               for r in range(1, 3)
               for a in range(41, 50)]
  fileNamesF.append(fileNames)
  copyFiles()
  
  
  path = healthActions_directory
  files = os.listdir(path)
  
  for index, file in enumerate(files):
      for i in range(len(fileNamesF)):
          os.rename(os.path.join(path, file),
          os.path.join(path, ''.join([str(fileNamesF[i]), '.csv'])))
  </code></pre>