FORUMS: list search recent posts

Worker / Command Line Interface / Overwrite existing fields / Paste Metadata

COW Forums : Square Box CatDV

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Leonid Nekrasov
Worker / Command Line Interface / Overwrite existing fields / Paste Metadata
on Jan 31, 2012 at 4:09:39 pm

Hi,

I am writing a shell script, that will search for a specific clip, copy it's metadata than make a new query for another specific clips and finally will paste the copied metadata from the first clip on all clips from the second query.

It works great with the Command Line Interface of the worker so far. But I have one problem with it:

1. Is there maybe already a ready to use copy&paste CLI command for this purpose, that I don't know about?

2. I only can use "set" to modify a clip field. But it only merges the fields. I cannot for some reason overwrite the field. For example if I want to update the "Status" field, that is already has an entry.

Does somebody know the workaround for this problem?

Thanx and best regards
Leo


Return to posts index

bryson jones
Re: Worker / Command Line Interface / Overwrite existing fields / Paste Metadata
on Jan 31, 2012 at 6:03:49 pm

That's interesting, on my setup, a "-set" command changes the value, it doesn't append. Is there a specific option you are passing other than -set U??=???

So far, as I've seen it, the Worker CLI is one field at a time, query, return result and then pass that to the field you want to write.

bryson

bryson "at" hidefcowboy.com

hidefcowboy.com


Return to posts index

Rolf Howarth
Re: Worker / Command Line Interface / Overwrite existing fields / Paste Metadata
on Jan 31, 2012 at 6:14:52 pm

Can you post details of the command line you're using? As far I can tell something like

catdv <i>query</i> -set STS=

should blank out the status field.



Return to posts index


Leonid Nekrasov
Re: Worker / Command Line Interface / Overwrite existing fields / Paste Metadata
on Feb 1, 2012 at 8:00:23 am

Hi,

that's strange :) Yesterday it didn't work. But today it seems to work like a charm. Maybe just the restart of the system was needed, what I don't really believe. I will do some more tests and will see if it work stable.

Here are some code snippets for any case:


# look up for a source clip to grab its metadata. print the metadata and wright them in a temporary text file.
catdv -query STS="new" -query CAT:2:Catalog1 -limit 1 -format bar -print ID,U72,U1,U2,U3,U4,U6,U8,U10,U21,U23,U26,U29,U50,U42 > $tmpfile

#read the tempfile and set new variabels
ID=`awk -v FS='|' 'NR==2 {print $1}' $tmpfile`
U72=`awk -v FS='|' 'NR==2 {print $2}' $tmpfile`
U1=`awk -v FS='|' 'NR==2 {print $3}' $tmpfile`
...

# now look for target clips and set the metadata from the variables
catdv -query U72:2:"$U72" -query CAT:2:CAPTURE -set STS="updated" -set U1="$U1" -set U2="$U2" -set U3="$U3" ...


maybe not a award winning script, but it works well for my purpose. I of course would appreciate any advises and ideas for improvement.

Best Regards
Leo


Return to posts index

Rolf Howarth
Re: Worker / Command Line Interface / Overwrite existing fields / Paste Metadata
on Feb 1, 2012 at 9:31:26 am

As will all shell scripts, something you have to be very careful about is handling of spaces and special characters and blank values and make sure they're properly quoted or escaped. Perhaps that's where the problem lies and it depends on your data?



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]