[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] $(PROCESS) - enumerate it?

you can do this, but due to some limitations in the parser for the $() expansion stuff, you have to use a temporary variable.

Add this to your submit file

  OutputId = $(Process)+1
  output = $INT(OutputId)

Note that Process is an alias for ProcId.  They both evaluate to the same thing, but ProcId is the actual attribute name that you see when you use condor_q -long. so the preferred form is this

  OutputId = $(ProcId)+1
  output = $INT(OutputId)

the $INT() macro expansion has an optional second argument that you can use to control the formatting, the main use for this is to get leading zeros.  for instance this:

  tmp = $(ProcId)+1
  output = $INT(tmp,%04d)

will produce the sequence 0001, 0002, 0003, etc

But leading an trailing characters in the formatting are honored, so this

  tmp = $(ProcId)+1
  output = $INT(tmp,file_%04d)

will produce the sequence file_0001, file_0002, file_0003, etc


-----Original Message-----
From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of lejeczek
Sent: Tuesday, September 19, 2017 6:34 AM
To: HTCondor Users Mailinglist <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] $(PROCESS) - enumerate it?

hi all

I'm reading docs on macros and I wonder(for I've not across 
yes) how to make something like: output = $(PROCESS)+1.

Simple thought here I had was how to start enumerate from 1 
since very rarely in my setups anything would start with 0.

many thanks,
p.s. beginner here, so go easy on me.

HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting

The archives can be found at: