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

340
Visualizações
Partial match file to string - String and CSV file both contain timestamp in the name, seconds of the difference between the two timestamps/names

I'm a complete JavaScript rookie...actually complete rookie with programming in general, so please bare with me.

Basically I have a Premiere Pro script that takes a CSV file and converts its data into clip markers, and that part works fine and everything.

The issue I'm currently dealing with:

Instead of just having to manually select a CSV file using File.openDialog() every time I want to generate markers, I thought I'd just hardcode the file path(always the same path so it made sense) + grab the clip name (both the CSV files and clips have a date timestamp as their names) and just grab the CSV from the path with the matching clip name.

var clip = // "insert clip name here.mp4", example: 2021-09-21 00-50-27.mp4       

var clipname = clip.name.replace(".mp4", '.csv'); //my janky way of dealing with the extensions lol
    
var userCsv = File (('/d/TIMESTAMPS/CSV/') + escape(clipname));

//userCSV example: "[File] /d/TIMESTAMPS/CSV/2021-09-21%2000-50-27.csv"

parseCsvData(userCsv);

Now, this works fine, except when the CSV's name timestamp is a few seconds behind, so the CSV file can no longer be matched to the clip name.

Example:

clip name: 2021-09-21 00-50-27.mp4

CSV name: 2021-09-21 00-50-29.csv¨

So now I'm trying to figure out a way to match the CSV to the clip even if the seconds in the timestamp/name are off, let's say give it a range of 10 seconds of difference and still be able to get a match.

Now I'm thinking of 2 possible ways to deal with this.

  1. Do the math and find the seconds of difference between the two
  2. Just match the two strings with minute accuracy and discard the seconds...and also hope that the timestamp doesn't hit 59 seconds and then get a difference in minutes between the two...I'd probably use File.openDialog() as a fallback in that case I guess.

I'm using Adobe ExtendScript Toolkit if that matters in any way.

Any idea on how to solve this? Thank you!

about 4 years ago · Juan Pablo Isaza
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