Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error en Carga

Quiero poner la fecha que trae el nombre del archivo en una variable, pero me da el siguiente error

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

Date(Right($(file),10)) as Fecha_Carga

from $(file)(txt, codepage is 1252, no labels, delimiter is ';', msq) ;

next file

========================= ERROR =========================

Error in expression:

')' expected

load *,

Date(Right(C:\Users\steam\Desktop\ENEL\GICO\Analisis Emidoc AC 10-2017.XLSX,10)) as Fecha_Carga

from C:\Users\steam\Desktop\ENEL\GICO\Analisis Emidoc AC 10-2017.XLSX(txt, codepage is 1252, no labels, delimiter is ';', msq)

12 Replies
Anonymous
Not applicable
Author

Você pode mandar um print de como essa coluna está no arquivo .xlsx?

Anonymous
Not applicable
Author

nao esta essa coluna em .xlsx, esse nome esta em el arquivo, lembra , 10-2017, for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')?

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

DATE(DATE#('$(file)', 'MM-YYYY'),'MM-YYYY') as Fecha_Carga

from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;

next file

Anonymous
Not applicable
Author

eu faz assim

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

Mid('$(file)', 53,7) as Carga

from '$(file)';

next file

esta pronto, muito brigado!!!. ate mais