Comments (9)
Try csv.use(io.stdin)
or maybe just csv.use()
, I think?
from lua-csv.
Both seem to give me this error (lua 5.2 and luajit):
lua: user_comment_size/lua/comment_count.lua:6: attempt to call a table value
stack traceback:
user_comment_size/lua/comment_count.lua:6: in main chunk
[C]: in ?
from lua-csv.
You're forgetting a :lines()
from lua-csv.
local csv = require("csv")
local count = 0
local size = 0
for fields in csv.use(io.stdin:lines()) do
--for line in io.stdin:lines() do
for i, v in ipairs(fields) do
size = size + 1
print(i, v)
end
count = count + 1
--io.write("count " , count, " size ", size, "\r")
end
io.write("count " , count, " size ", size, "\n")
from lua-csv.
Try
for fields in csv.use(io.stdin):lines() do
from lua-csv.
Error:
lua: user_comment_size/lua/comment_count.lua:6: /usr/local/share/lua/5.2/csv.lua:150: attempt to index local 'parameters' (a nil value)
stack traceback:
[C]: in function 'for iterator'
user_comment_size/lua/comment_count.lua:6: in main chun
from lua-csv.
Worked like this:
for fields in csv.use(io.stdin, {}):lines() do
from lua-csv.
Thanks a lot!
from lua-csv.
Weird, you shouldn't need to do that, and you shouldn't have got an error at line 150. This line is there so that parameters is optional. Oh well...
from lua-csv.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-csv.