Forum

Write and Read a Spread off values

I was puzzeling on how I can store a spread off values in a text file, and retrieve them later.

The problemm I noticed was that the Writer (file) node would only Save one slice (the last slice) off a String spread (hope you are still with me).

So I made a work arround to convert all my values to strings, and then make it in one value off a string, seperated by a SPACE. This can be stored/read with the Writer (file) and Reader (file) nodes.

Next trick was to get the values back again in the same spread I started with.

I attached my Patch, I am sure I re-invented yet another wheel, so if some one has a better idea, please share it with me.

Thnx for the time.

Read Write Value Spread.v4p (11.9 kB)

note that we silently introduced Separate (String) in one of the last betas. it does the reverse of + (String, Spectal).

the advantage of this method is that you can write CSV files, which can be easily edited by the likes of Microsoft Excel.

the behaviour of the Writer (file) is somewhat bizarre but expected. you rewrite the same file for each slice.
we could have built in a special mode which appends all stuff written to the same file in the same frame.

Yes, basicly that is what I wanted, beeing able to use EXEL.

Hehe, that will make 1 step less for me ;) Thnx for that.

The timetable.csv from the resources folder is missing!! (helpfile Seperate (string) beta9.2)

timetable.csv added to vcs

I think I will stay with SPLIT for my patch, the Seperate node works a bit too unpredictable for me.

Other Q:

Does it mather if the READ pin from the reader (file) is 1 constant, or do I need to bang it?? (like: does it realy reads and using my diskdrive all the time…)

That was me offours.

Very anoying that anonymous can post as well.

works a bit too unpredictable for me

is this a bug report?

Does it mather if the READ pin from the reader (file) is 1 constant, or do I need to bang it?? (like: does it realy reads and using my diskdrive all the time…)

yes, it reads the file every frame, as long as READ is 1

is this a bug report?

Yes, well, I can send you a patch I made, using a space to seperate the values, and sometimes it counts 2 spaces (I think) and I end up with an empty value in my spread.

But for CVS it works prety good :)

Okay, so if use a reader (file) node, with data that does not change, it best for the system to just use a ‘bang on startup’ node. I am soo afraid that it misses the bang, I know that is not supposed to happen, but that is just me beeing paranoid ;)

Thnanks again for the explenation.

Separate catches every single Space (ascii #32) and interprets it as the separator. If there is nothing between two #32 Characters, there will be an empty Slice. You might want that if you want to keep empty cells from a Excel Sheet…

For me the reader acts buggy too. Naver had probs with on StartUp Bang though. Maybe try to connect the output with an IOBox. It helped me out often for some reasons.