我们正在做一个API项目。我们正在请求一些在特定网址上发布的数据,如下所示
var dd = Request.Params.Get(0);
如果我们请求这样的数据,我们就不会获得在url上发布的请求数据。
在url上发布的JSON数据是这样的。
Data : {"939":"11746906","217":"11825752"}
{"641":"11722153,11722167,11722187","392":"11830778,11830781"}
{"863":"11742961,11742968,11742972,11742984,11742992,11742994,11742998,11743002"}
{"125":"11754845,11754846,11754847,11754848,11754849,11754850"}
{"992":"11749462,11749463,11749464"}
{"1092":"11753386,11753387"}
答案 0 :(得分:0)
假设您正在使用GET来检索JSON:
for f in /home/cmccabe/Desktop/20x/percent/*.txt ; do
bname=$(basename $f)
pref=${bname%%_base_*.txt}
awk -v OFS='\t' '{ sum += $2 } END { if (NR > 0) print sum / NR }' $f /home/cmccabe/Desktop/NGS/bed/bedtools/IDP_total_target_length_by_panel/IDP_unix_trim_total_target_length.bed > /home/cmccabe/Desktop/20x/coverage/${pref}_average.txt
done