spikey
spikey

Reputation: 13

file-write output without quotation marks

I want to write an output file with some information in Netlogo. It works fine so far but i wonder if i can write strings without quotation marks. It would help me alot in analysing my data. I could use another programm to delete the quotation marks but i would like to generate the file without them if its possible.

For example: i want to generate the output:

2_100_1 / 0.05081157374735357

3_100_1 / 0.09989594172736732

but i get the output

"2_100_1 / 0.05081157374735357"

"3_100_1 / 0.09989594172736732"

The problem seems to be that i use word, but i have no idea how i can fix this.

Any help is appreciated

file-write (word frequenz "_" transferrate "_" dangerradius " / " (overall-wait / ticks))

Upvotes: 1

Views: 248

Answers (1)

mattsap
mattsap

Reputation: 3806

You can use file-print instead.

From the Netlogo Dictionary:

file-write outputs quotes around strings.

file-write value This command will output value, which can be a number, string, list, boolean, or nobody to an opened file, not followed by a carriage return (unlike file-print and file-show).

This agent is not printed before the value, unlike file-show. Its output also includes quotes around strings and is prepended with a space. It will output the value in such a manner that file-read will be able to interpret it.

Note that this command is the file i/o equivalent of write, and file-open needs to be called before this command can be used.

file-print:

file-print value Prints value to an opened file, followed by a carriage return.

This agent is not printed before the value, unlike file-show.

Note that this command is the file i/o equivalent of print, and file-open needs to be called before this command can be used.

See also file-show, file-type, file-write, and Output (programming guide).

Upvotes: 1

Related Questions