Lua and tab separated values

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Lua and tab separated values

Post by darkfrei »

Hi all!

I want to save some data as

Code: Select all

tablData = {	-- table of values
		b="yes",
		d="text",
		c=false,
		a=true,
		e={2, 3, 4, true, "text"}, -- list of values
		[1]=1,
		[2]=true,
		[3]=false,
		[4]="text",
		true="yes",
		false="no",
	}
to the .TSV (tab separated values):

Code: Select all

1	1
2	true
3	false
4	text
b	yes
true	yes
false	no
d	text
c	true
a	true
e	2	3	4	true	text

and here is an example how to do it:
save-tsv-01.love
cc0 / “No Rights Reserved”
(1.9 KiB) Downloaded 158 times
Attachments
save-tsv.lua
save-tsv-01
(2.41 KiB) Downloaded 140 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests