FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Edición de archivo txt de fichadas
Estimados, buenas tardes.
Recurro a ustedes para consultarles que me recomiendan: tengo un archivo arch1.txt con el siguiente formato: 102 06/02/2014 5:57 19 06/02/2014 6:07 8 06/02/2014 8:25 y tengo que generar un arch2.txt editandolo de esta manera: 102 06/02/2014 05:57 019 06/02/2014 06:07 008 06/02/2014 08:25 Como verán tengo que hacer un arch2.txt de posición fija, es decir, 3 dígitos al comienzo, espacio, 10 caracteres para la fecha, espacio, 5 caracteres para la hora. La apertura del primer archivo y su lectura lo tengo hecho, el tema es que no se me ocurre como editar el arch2.txt para que tome los cambios. Pense en guardar todo en un memo pero el archivo es largo y la idea seria a medida que leo el primer renglón de arch1.txt, editarlo si es necesario y guardar el nuevo registro en el arch2.txt. Ustedes que opinan es viable hacerlo de esta manera? Desde ya, muchas gracias. Saludos. |
#2
|
|||
|
|||
Esperando que este codigo te pueda ayudar. Saludos.
102 06/02/2014 5:57 19 06/02/2014 6:07 8 06/02/2014 8:25 06/02/2014 5:57 06/02/2014 6:07 06/02/2014 8:25 12345678901234567890
__________________
Guillermo Crespo Pichardo crespopg@yahoo.com
Última edición por ecfisa fecha: 11-02-2014 a las 21:29:47. Razón: Agregar etiquetas [DELPHI] [/DELPHI] |
#3
|
||||
|
||||
Hola cardanver.
Otra propuesta:
Ejemplo de uso:
Saludos
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#4
|
|||
|
|||
Muchas gracias por su ayuda crespopg y ecfisa...
En la brevedad pruebo las opciones... Después subo todo el archivo así si alguno lo necesita lo usa. Saludos y nuevamente gracias... |
#5
|
||||
|
||||
cardanver,
Cita:
El código anterior asume que la fecha del archivo de entrada viene en el formato DD/MM/AAAA como se indica en el Msg #1 y genera un archivo de salida en el formato 'NNN DD/MM/YYYY HH:MM', según se indica en el requerimiento planteado. Espero sea útil Nelson. |
#6
|
|||
|
|||
Muchas gracias nlsgarcia.
Probé los tres códigos, este ultimo me respondió mejor. En la brevedad subo todo el soft con el entorno así queda para quien lo necesite. Saludos a todos y muchas gracias. |
#7
|
|||
|
|||
el codigoooo
Estimados buen dia.
Como lo prometi subo el codigo para que si otro lo necesita lo tenga. Le hice un par de ediciones que estan aclaradas en el mismo codigo. A modo aclarativo el archivo1 es el log de un lector biometrico y el archivo2 es lo que necesita un soft de gestion para calcular las jornadas de los operarios. Hay un par de lineas que se deben a que el archivo original es asi: AC-No. Estado 102 06/02/2014 5:57 102 06/02/2014 5:57 102 06/02/2014 15:57 19 06/02/2014 6:07 19 06/02/2014 16:07 8 06/02/2014 8:25 8 06/02/2014 18:25 y en el archivo final no debe estar el titulo ni el espacio en blanco.
Ahora estoy viendo como puedo hacer para que solo figuren la entrada y salida, ya que, a veces tengo en un mismo dia varias marcadas y solo son necesarias la primera y la ultima. Si alguien tiene alguna idea, le agradeceria que la comente. Si logro hacerlo andar vuelvo a subir el codigo completo. Saludos y muchas gracias a todos por su ayuda. |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Edicion de un DBGRID | Wbarrantes | OOP | 21 | 06-10-2010 17:13:54 |
Edición de IP | FerCastro | Varios | 2 | 10-03-2007 00:46:59 |
Edicion DBGrid | Caro | Conexión con bases de datos | 2 | 09-06-2006 18:02:26 |
Como puedo cambiar la propiedad de edicion y no edicion a un StringGrid1 | ctronx | Varios | 2 | 25-06-2004 23:10:19 |
¿Edicion de datos? | m@r | SQL | 6 | 17-10-2003 17:00:44 |
|