diff options
author | chai <chaifix@163.com> | 2021-10-30 11:32:16 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-30 11:32:16 +0800 |
commit | 42ec7286b2d36a9ba22925f816a17cb1cc2aa5ce (patch) | |
tree | 24bc7009457a8d7500f264e89946dc20d069294f /Data/Libraries/Penlight/examples/testinputfields2.lua | |
parent | 164885fd98d48703bd771f802d79557b7db97431 (diff) |
+ Penlight
Diffstat (limited to 'Data/Libraries/Penlight/examples/testinputfields2.lua')
-rw-r--r-- | Data/Libraries/Penlight/examples/testinputfields2.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Data/Libraries/Penlight/examples/testinputfields2.lua b/Data/Libraries/Penlight/examples/testinputfields2.lua new file mode 100644 index 0000000..fc649eb --- /dev/null +++ b/Data/Libraries/Penlight/examples/testinputfields2.lua @@ -0,0 +1,9 @@ +local input = require 'pl.input' +local seq = require 'pl.seq' +local text = [[ + 981124001 2.0 18988.4 10047.1 4149.7 + 981125001 0.8 19104.0 9970.4 5088.7 + 981127003 0.5 19012.5 9946.9 3831.2 +]] +local sum,count = seq.sum(input.fields ({3},' ',text)) +print(sum/count) |