Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String KDB:将函数应用于字典中的所有值_String_Function_Dictionary_Kdb - Fatal编程技术网

String KDB:将函数应用于字典中的所有值

String KDB:将函数应用于字典中的所有值,string,function,dictionary,kdb,String,Function,Dictionary,Kdb,我有一本字典,不同的前缀对应不同的键。我想在字典中的每个值上附加和预设字符串 例如: filePrefixes: `QCentral`QWest`QEast!("GLO_CCEUML_CSFBSL_";"GLO_CCALML_CSFBSL_";"GLO_CCAPML_CSFBSL_") 我想预先挂起folderPath并附加dateFormat和文件扩展名“.csv” 所以字典应该是这样的: filePrefixes: `QCentral`QWest`QEast!("..\..\code\pr

我有一本字典,不同的前缀对应不同的键。我想在字典中的每个值上附加和预设字符串

例如:

filePrefixes: `QCentral`QWest`QEast!("GLO_CCEUML_CSFBSL_";"GLO_CCALML_CSFBSL_";"GLO_CCAPML_CSFBSL_")
我想预先挂起folderPath并附加dateFormat和文件扩展名“.csv”

所以字典应该是这样的:

filePrefixes: `QCentral`QWest`QEast!("..\..\code\products\Q\ShortLocator2\Request Files\1\GLO_CCEUML_CSFBSL_20181203_1948.csv";"..\..\code\products\Q\ShortLocator2\Request Files\1\GLO_CCALML_CSFBSL_20181203_1948.csv";"..\..\code\products\Q\ShortLocator2\Request Files\1\GLO_CCAPML_CSFBSL_20181203_1948.csv")
我做了这样的事。不确定是否有更好的方法:

  filename: (value filePrefixes),\:(dateFormat,".csv");
  filePaths: string[folderPath],/:(filename);
  filePrefixes:(key filePrefixes)!(filePaths);

如果有帮助,可以直接在字典中修改这些值。根据示例代码对
dateFormat
folderPath
进行一些假设:

dateFormat:"20181203_1948";
folderPath:"..\\..\\code\\products\\Q\\ShortLocator2\\Request Files\\1\\"
这可以与上面提供的步骤结合使用,而无需提取值:

q)show filePrefixes:folderPath,/:filePrefixes,\:dateFormat,".csv"
QCentral| "..\\..\\code\\products\\Q\\ShortLocator2\\Request Files\\1\\GLO_CCEUML_CSFBSL_20181203_1948.csv"
QWest   | "..\\..\\code\\products\\Q\\ShortLocator2\\Request Files\\1\\GLO_CCALML_CSFBSL_20181203_1948.csv"
QEast   | "..\\..\\code\\products\\Q\\ShortLocator2\\Request Files\\1\\GLO_CCAPML_CSFBSL_20181203_1948.csv"
本质上,这些值就像一个列表,其中有一些限制在Q中针对凡人简要讨论