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

Re: [HTCondor-users] correct split function syntax



Hi Thomas,

sorry for not figuring this out when we were talking before. D:

You need *double*-quotes for strings, including the split tokens:
	split(AccountingGroup, ".â)
	split(AccountingGroup, ".")[0]

Cheers,
Max

> On 17. Mar 2022, at 17:32, Thomas Hartmann <thomas.hartmann@xxxxxxx> wrote:
> 
> Hi all,
> 
> I am struggling on how to use split() correctly.
> 
> I would like to extract the group name from a job's AccountingGroup by
> splitting the ad.
> So I tried something like [1.a] - which unfortunately ends up in an
> error [1.b].
> 
> The default split [2.a] with white spaces as delimiters seem to work 'in
> principle' [2.b].
> I guess, that the delimiter token argument has to look a bit different?
> 
> Cheers and thanks for hints,
>  Thomas
> 
> [1.a]
> JOB_TRANSFORM_NAMES = $(JOB_TRANSFORM_NAMES),  FOOTrafo
> JOB_TRANSFORM_FooTrafo @=end
> 
> #strcat (eval?) for explicit string representation
> SET tmpAccountingUser = split(strcat(AccountingGroup),'.')
> # SET tmpAccountingUser = split(strcat(AccountingGroup),.)
> SET DESYAcctGroupNeu = tmpAccountingUser[0]
> 
> @end
> 
> [1.b]
>> condor_q 1234.0 -af AccountingGroup ConcurrencyLimits DESYAcctGroupNeu
> tmpAccountingUser
> group_DESY.desytst004 group_DESY.desytst004 error error
> 
> 
> [2.a]
> ...
> SET tmpAccountingUser = split(strcat(AccountingGroup))
> ...
> 
> [2.b]
>> condor_q 1235.0 -af AccountingGroup ConcurrencyLimits DESYAcctGroupNeu
> tmpAccountingUser
> group_DESY.desytst004 group_DESY.desytst004 group_DESY.desytst004 {
> "group_DESY.desytst004" }
> _______________________________________________
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
> 
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/htcondor-users/