daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. proc csv {file} {
  2.    
  3.     # Abrimos el csv
  4.     set fs [open $file]
  5.     set buffer [split [read $fs] \n]
  6.     close $fs
  7.    
  8.     # Recorremos el fichero línea a línea
  9.     foreach line [lsort $buffer] {
  10.         #Añadimos la categoría del array
  11.         set CatArray "01"
  12.         #cat_discos_25_mm, 100, 1, Copa Plateada, 12cm, 20.00€
  13.         #100-1-01, Copa Plateada, 12cm, 20.00€
  14.         #
  15.         set cat [lindex [split $line {,}] 1]
  16.         set Numero [lindex [split $line {,}] 2]
  17.         set rest [join [lrange [split $line {,}] 3-end] {,}]
  18.         return $cat-$Numero-$CatArray,$rest
  19.        
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top