probonopd / irdb

One of the largest crowd-sourced, manufacturer-independent databases of infrared remote control codes on the web, and aspiring to become the most comprehensive and most accurate one
Other
801 stars 149 forks source link

How many ‘POWER’ commands in the irdb ? #41

Closed nodecentral closed 3 years ago

nodecentral commented 3 years ago

Hi

How many ‘POWER’ commands are there for all the devices listed in the irdb ? I’ve tried to create a script to check all the .csv files, and it looks like I’ve found 120 ? Does that sound right to you ?

bengtmartensson commented 3 years ago

From a cloned repository, in top directory:

$ grep   -r -i  power  codes | sort -u | wc -l
3021
nodecentral commented 3 years ago

Ok, thanks I’m way off then, :-)

It seems the on/off power command is recorded in the .csv files in many different formats, i.e "POWER", “Power", "Quick Power", "PowerOn", "PowerOff", "power" - uppercase, lowercase you name it, but the word power seems to be consistently used.

Is there a magic regex or something that will find every possible variation ?

bengtmartensson commented 3 years ago

For example, the given command matches everything that contains "power", ignoring case. This should do what you want. The magic is missing though; you have to add that yourself ;-).

nodecentral commented 3 years ago

Many thanks I’m trying to find the magic ;-) , but sadly working with Lua, it doesn’t seem quite so straight forward :-)

The following is the closest I’ve got so far,

if string.match(func_name, "POWER")

687 now found..

bengtmartensson commented 3 years ago

Questions about Lua programming are off-topic here. The original questing has been answered. Therefore closing.