Groovy web console

subscribe to the feed Subscribe
to this
site

Fill CSV missing delimiters

Published 5 months ago by Bais with tags cpi csv
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
testo = '''EXTRACT|2022-06-30|0||11''';
empty = ''
numero_campi = 10
if (testo.count("|") != numero_campi){for (i = 0; i <= testo.count("|")+1; i++) { empty = empty + '|'}}

result = testo+empty

println(testo.count("|"))
println(testo+empty)
println(result.count("|"))