These forums are archived

See this post for further info

get_iplayer forums

Forum archived. Posting disabled.

Probelem with --fields option

user-431

I use the command
Code:
get_iplayer "^BBC News$" --type=radio
to search.
The result is like below and full result is attached:
11104: BBC News - 23/02/2014, BBC World Service, News,Radio
11126: BBC News - 25/02/2014, BBC World Service, News,Radio
11147: BBC News - 26/02/2014, BBC World Service, News,Radio

So I only want to choose the programme on the 2014.02.26.
Code:
get_iplayer "^BBC News$" --type=radio --fields=episode "26/02/2014"
But the result is not my expectation.

result.txt

user-2

In your second command, you've specified two search expressions:
Code:
"^BBC News$"
and
Code:
"26/02/2014"
. Only the latter will be found in the
Code:
episode
field. In your first command with no
Code:
--fields
options specified, the search was performed against the
Code:
name
field (the default). A hint: If you search against two fields, e.g.,
Code:
--fields=name,episode
, the search is performed against the space-concatenated values of both fields:
Code:
"<name> <episode>"
.

user-431

I don't want to search one string in both two fields.
I want to search
Code:
"^BBC News$"
in
Code:
name
field and search
Code:
"26/02/2014"
in
Code:
episode
field.
how can I achieve this in one command?

If above method could not be done in the get_iplayer command, how can I narrow done the result in the result.txt with your recommendation?
I have tried the below command but it is no effect.
Code:
get_iplayer --type=radio --fields=name,episode "^BBC News$" "26/02/2014"

Thank you user-2 very much!

user-2

Quote:Quote:I don’t want to search one string in both two fields.

I want to search
Code:
"^BBC News$"
in
Code:
name
field and search
Code:
"26/02/2014"
in
Code:
episode
field.

how can I achieve this in one command?

You can't search two fields separately at the same time.

Quote:If above method could not be done in the get_iplayer command, how can I narrow done the result in the result.txt with your recommendation?

I have tried the below command but it is no effect.

Code:
get_iplayer --type=radio --fields=name,episode "^BBC News$" "26/02/2014"

Re-read my earlier post. You're searching against a concatenation of two fields, so you should use one search expression, not two. If you're searching against two concatenated fields, what do you suppose you should do with your two search expressions? Another hint:
Code:
"^BBC News$"
is a regular expression (do some googling if you don't know what those are) that limits the entire matched value to just "BBC News". Since you're searching against a concatenation of
Code:
name
and
Code:
episode
, that condition can never be met.

These forums are archived

See this post for further info