MS-Dos, Bat Simple?
Publicado por WiKe (2 intervenciones) el 16/11/2016 13:45:42
Hola a todos
Lo que quiero es muy facil de entender, lo dificil que no se bien k comandos usar en bat para conseguirlo
Tengo varios fichero TXT con unas 20.000 lineas cada uno, el problema que algunos tienen una sangria de 10 caracteres, y otros de 16, y otros de 5... lo que al trabajar con todos me produce errores
Me gustaria saber como crear un bat (por si me lo quereis explicar) o que bat necesito
lo que necesito es un bat, al que yo le pase un fichero de texto, y me pregunte un valor numerico, y me elimine esos X caracteres de TODAS las lineas:
EJ 1:
TENGO:
ARCHIVOACAMBIAR.TXT
123456789
123456789copyright (c) 2001 Fabrice Bellard
123456789
123456789This file is part of FFmpeg.
123456789
123456789FFmpeg is free software; you can redistribute it and/or
123456789modify it under the terms of the GNU Lesser General Public
123456789License as published by the Free Software Foundation; either
123456789version 2.1 of the License, or (at your option) any later version.
//ESTE TEXTO NO LO KIERO, ES SOLO A MODO INFORMATIVO: (ME PREGUNTA NUMERO DE CARACTERES Y PARA ESTE EJEMPLO ELIJO "9")
LA SALIDA QUE QUIERO;
ARCHIVOCAMBIADO.TXT
copyright (c) 2001 Fabrice Bellard
This file is part of FFmpeg.
FFmpeg is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
//ESTE TEXTO NO LO KIERO, ES SOLO A MODO INFORMATIVO: (SE HAN ELIMINADO 9 CARACTERES DE CADA LINEA)
EJ 2:
TENGO:
ARCHIVOACAMBIAR.TXT
123456789012
123456789012copyright (c) 2001 Fabrice Bellard
123456789012
123456789012This file is part of FFmpeg.
123456789012
123456789012FFmpeg is free software; you can redistribute it and/or
123456789012modify it under the terms of the GNU Lesser General Public
123456789012License as published by the Free Software Foundation; either
123456789012version 2.1 of the License, or (at your option) any later version.
//ESTE TEXTO NO LO KIERO, ES SOLO A MODO INFORMATIVO: (ME PREGUNTA NUMERO DE CARACTERES Y PARA ESTE EJEMPLO ELIJO "12")
LA SALIDA QUE QUIERO;
ARCHIVOCAMBIADO.TXT
copyright (c) 2001 Fabrice Bellard
This file is part of FFmpeg.
FFmpeg is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
//ESTE TEXTO NO LO KIERO, ES SOLO A MODO INFORMATIVO: (SE HAN ELIMINADO 12 CARACTERES DE CADA LINEA)
Muchas gracias por adelantado
Lo que quiero es muy facil de entender, lo dificil que no se bien k comandos usar en bat para conseguirlo
Tengo varios fichero TXT con unas 20.000 lineas cada uno, el problema que algunos tienen una sangria de 10 caracteres, y otros de 16, y otros de 5... lo que al trabajar con todos me produce errores
Me gustaria saber como crear un bat (por si me lo quereis explicar) o que bat necesito
lo que necesito es un bat, al que yo le pase un fichero de texto, y me pregunte un valor numerico, y me elimine esos X caracteres de TODAS las lineas:
EJ 1:
TENGO:
ARCHIVOACAMBIAR.TXT
123456789
123456789copyright (c) 2001 Fabrice Bellard
123456789
123456789This file is part of FFmpeg.
123456789
123456789FFmpeg is free software; you can redistribute it and/or
123456789modify it under the terms of the GNU Lesser General Public
123456789License as published by the Free Software Foundation; either
123456789version 2.1 of the License, or (at your option) any later version.
//ESTE TEXTO NO LO KIERO, ES SOLO A MODO INFORMATIVO: (ME PREGUNTA NUMERO DE CARACTERES Y PARA ESTE EJEMPLO ELIJO "9")
LA SALIDA QUE QUIERO;
ARCHIVOCAMBIADO.TXT
copyright (c) 2001 Fabrice Bellard
This file is part of FFmpeg.
FFmpeg is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
//ESTE TEXTO NO LO KIERO, ES SOLO A MODO INFORMATIVO: (SE HAN ELIMINADO 9 CARACTERES DE CADA LINEA)
EJ 2:
TENGO:
ARCHIVOACAMBIAR.TXT
123456789012
123456789012copyright (c) 2001 Fabrice Bellard
123456789012
123456789012This file is part of FFmpeg.
123456789012
123456789012FFmpeg is free software; you can redistribute it and/or
123456789012modify it under the terms of the GNU Lesser General Public
123456789012License as published by the Free Software Foundation; either
123456789012version 2.1 of the License, or (at your option) any later version.
//ESTE TEXTO NO LO KIERO, ES SOLO A MODO INFORMATIVO: (ME PREGUNTA NUMERO DE CARACTERES Y PARA ESTE EJEMPLO ELIJO "12")
LA SALIDA QUE QUIERO;
ARCHIVOCAMBIADO.TXT
copyright (c) 2001 Fabrice Bellard
This file is part of FFmpeg.
FFmpeg is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
//ESTE TEXTO NO LO KIERO, ES SOLO A MODO INFORMATIVO: (SE HAN ELIMINADO 12 CARACTERES DE CADA LINEA)
Muchas gracias por adelantado
Valora esta pregunta


0