I am working with a text like this one(a .cnf file):
p cnf 5 5
c Thus, this file contains a problem with 5 variables and 5 clauses.
c The following are the clauses for this file:
1 2 3 4 5 0
-1 -2 -3 -4 -5 0
1 -2
3 -4 5 0
5 0
-1 2 0
I need to make a array with the lines that start with numbers, but they must end at the 0 and cut it, so I can generate a array like this:
[
[1, 2, 3, 4, 5],
[-1, -2, -3, -4, -5],
[1, -2, 3, -4, 5],
[5],
[-1, 2]
]
I am trying to do this at javascript (working with node.js).
I would be so grateful if someone could help me.