How can i properly copy multiple lines in the output?

I’ve printed a series of numbers in the output during playtesting, and now i want to put them in a script as a table.

I hit right click and copy, generated a new script, and pasted it in- EW.

This is not what i want. I don’t want to select these dots and delete them countless times manually.
I did try the Find + Replace feature, but for some reason they detect the characters, but replacing doesn’t work at all.

Is there a better way to deal with this? Any help is appreciated.

1 Like

So you want basically when it prints random generated numbers or whatever you’re printing to the output you want it also to copy it and paste it into a script where you can visibly see it?

Yes
Anything without those weird characters

You can make a custom function to print the table

local t = {}
for i = 1, 10 do
	table.insert(t, math.random())
end

local function printTable(t)
	local str = ""
	for i, v in ipairs(t) do
		str = str .. string.format("\t[%d] = %f,\n", i, v)
	end
	print(string.format("local tab = {\n%s}", str))
end

printTable(t)
--> Output:
local tab = {
	[1] = 0.191277,
	[2] = 0.965295,
	[3] = 0.847141,
	[4] = 0.613368,
	[5] = 0.562236,
	[6] = 0.407031,
	[7] = 0.209487,
	[8] = 0.037708,
	[9] = 0.900206,
	[10] = 0.204109,
}

Find and replace seems like a pretty straightforward solution here.

Apparently i was copying it wrong.

Before this is right-clicked the output window background and copied.
I fixed the character issue by right-clicking the printed text on the output instead and the weird characters only appeared on one line :relieved:

1 Like