Ruta fichero
Publicado por Adirane (3 intervenciones) el 11/12/2006 10:33:12
Hola, a ver si me podéis ayudar...me descargué un script en visual basic para convertir un fichero xml en un .csv, para ello le tengo que pasar la ruta de dónde está el fichero xml...y mi problema es que las rutas que yo tengo tienen esta forma aaaammdd_hhmmss, y no puedo saber el nombre de la carpeta, porque no sé la hora a la que se ha generado...por ejemplo 20061211_1038...
¿Cómo puedo hacer para que me busque los que siguen ese patrón? Lo ideal sería una vez encontrados renombrarlos en plan 20061211_1, 20061211_2..pero ese ya es otro cantar...
rutaxml(1) = "C:\ficherosxml\rep0003\in\20061211_1038"\pedidocabecera.xml"
rutaxsl(1) = "c:\xml-csv\pedidocabecera.xsl"
rutacsv(1) = "C:\ficherosxml\rep0003\in\20061211_1038\pedidocabecera.csv"
i=1
n=14
n=n+1
While i < n
xmlSource.Load rutaxml(i) ' This loads the text that I want to transform
If Err.Number <> 0 Then
strErr = Err.Description & vbCrLf
strErr = strErr & xmlSource.parseError.reason & " line: " & xmlSource.parseError.Line & " col: " & xmlSource.parseError.linepos & " text: " & xmlSource.parseError.srcText
MsgBox strErr, vbCritical, "Error loading the XML"
End If
¿Cómo puedo hacer para que me busque los que siguen ese patrón? Lo ideal sería una vez encontrados renombrarlos en plan 20061211_1, 20061211_2..pero ese ya es otro cantar...
rutaxml(1) = "C:\ficherosxml\rep0003\in\20061211_1038"\pedidocabecera.xml"
rutaxsl(1) = "c:\xml-csv\pedidocabecera.xsl"
rutacsv(1) = "C:\ficherosxml\rep0003\in\20061211_1038\pedidocabecera.csv"
i=1
n=14
n=n+1
While i < n
xmlSource.Load rutaxml(i) ' This loads the text that I want to transform
If Err.Number <> 0 Then
strErr = Err.Description & vbCrLf
strErr = strErr & xmlSource.parseError.reason & " line: " & xmlSource.parseError.Line & " col: " & xmlSource.parseError.linepos & " text: " & xmlSource.parseError.srcText
MsgBox strErr, vbCritical, "Error loading the XML"
End If
Valora esta pregunta


0