Replace , with \t (tab)

hi @Ruri parsed a list where the values are in this format

"maximumCapacity":17,"bookings":4,"availableCapacity":13,"startTimeslot":"2021-07-25T06:00:00Z","hasAvailability":true

I want to change the , for a tab like this

"maximumCapacity":17	"bookings":4	"availableCapacity":13	"startTimeslot":"2021-07-25T06:00:00Z"	"hasAvailability":true

so i can paste them in excel I used the replace block but I don’t know what to put as replacement

Put \t as replacement and then use the Unescape block to transform \t into an actual tab. Otherwise you can try to copy a tab character inside the textbox of the replace, but I don’t know if it works.

Screenshot 2021-07-23 at 17.03.07

this doen’t work and copy pasting tab also doesn’t work

No man, as input you have to put the variable you captured. It will unescape all escape character inside the input string, which is the variable containing those characters. If you don’t give the variable to the block how can it know which string to unescape? xD


before unescape

"maximumCapacity":3\t"bookings":2\t"availableCapacity":1\t"startTimeslot":"2021-07-25T05:00:00Z"\t"hasAvailability":true\t

after unescape

"maximumCapacity":3,"bookings":2,"availableCapacity":1,"startTimeslot":"2021-07-25T05:00:00Z","hasAvailability":true,

XD

You have to pass replaceOutput to the second block, or you have to overwrite the tijden variable in the first block. Those blocks do not modify the existing variable, they create a new one. So if you want them to output to the same variable, the “output variable” should be names exactly as the input variable.

hi @Ruri i tried putting /n and that worked but when i try /t it does nothing


I don’t have time to check now, but you can use C# to do it if you want. Remove the replace and unescape blocks and just write this in LoliCode (in a new line below ENDBLOCK after the parse block)

tijden = tijden.Replace(",", "\t");

Should work