English 中文(简体)
NetLogo:细线中断产出档案? 并非如此简单。
原标题:NetLogo: line break in output file?? Not so simple.

我尝试了所有备选办法,以便在我的产出档案中建立一个新线,但我仍然拿着一张 t子——笔记——前信息。 即便有这一超文本法典:

全球[档案]

to setup   clear-all
    set file "results\GA1.txt"   if is-string? file
     [while [file-exists? file]
        [set file replace-item (length file - 5) file "11" ]
      file-open file] end

to go   tick   write-to-file end

to write-to-file   file-print (word ticks) FILE-TYPE "
"   file-write 1 file-print (word " " 2 ";")   file-write 1 file-print (word " " 2 ";")     file-print ""  ;; blank line end

我没有空线或线断。 I work in NetLogo 4.1. 是否有任何人知道问题是什么?

问题回答

页: 1

当你填写<代码>.file-write时,数据不能立即打印。 它被置于缓冲地带。 当缓冲面积足够大时,数据便被写成软盘。 您可使用<代码> file-flush或file-close的指令将数据输入文档。

参考文件建议使用更好的编辑。 但是,有办法让“灯塔”发挥作用。

If you add the string " " to your data (with file-type or whatever), it works with Notepad.

Notepad uses the older carriage return (" ")/ new line (" ") format. The Unix systems just use new line.

对我来说,这是一件事。

file-open "locations.txt"
   ask turtles
   [file-print xcor]
file-close

如果你想有更多的休息时间,那么就利用这一机会。

file-open "locations.txt"
   ask turtles
   [file-print xcor file-print "
"]
file-close




相关问题
How can I load a folders files into a ListView?

I d like to have a user select a folder with the FolderBrowserDialog and have the files loaded into the ListView. My intention is to make a little playlist of sorts so I have to modify a couple of ...

File Handling Issue

I am developing a tool in c#, at one instance I start writing into a xml file continuously using my tool,when i suddenly restart my machine the particular xml file gets corrupted, what is the reason ...

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Saving output of a for-loop to file

I have opened a file with blast results and printed out the hits in fasta format to the screen. The code looks like this: result_handle = open("/Users/jonbra/Desktop/my_blast.xml") from Bio.Blast ...

热门标签