Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
Simple renaming - remove (JOB_0000_) from file name

I work with software that generates an output files with the names: JOB_1_sample-file_20220211083122.txt in a specific folder. There are thousands of files at the same time.

The beginning of the text file is variable (JOB_1,JOB_2,JOB_3,etc).

Example: JOB_2_sample-file_20220211083122.txt, JOB_34_sample-file_20220211083122.txt, JOB_1007_sample-file_20220211083122.txt.

I need to remove the initials from the files, leaving only the 'sample' forward. Preferably using Powershell, CMD or javascript.

Is there such a possibility?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Use Rename-Item with a delay-bind script block, combined with a -replace operation that uses a regex to remove the prefix of interest:

$dir = '.' # specify target dir.
Get-ChildItem -LiteralPath $dir -Filter *.txt |
  Rename-Item -NewName { $_.Name -replace '^JOB_\d+_' } -WhatIf

Note: The -WhatIf common parameter in the command above previews the operation. Remove -WhatIf once you're sure the operation will do what you want.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda