Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using the <code>freads</code> verb will force line endings to be <code>LF</code>. If you are using J6 or earlier then you will need to load the <a href="http://www.jsoftware.com/wsvn/base8/trunk/main/main/files.ijs" rel="nofollow" title="files script">files script </a> first (<code>load 'files'</code>), otherwise <code>freads</code> is available as part of the standard library. Then as Eelvex suggests <a href="http://www.jsoftware.com/help/dictionary/d331.htm" rel="nofollow" title="cut">cut</a> <code>;.</code> more specifically <code>;._2</code> can be used to divide the lines of the file using the last character in the string (in this case <code>LF</code>) as the delimiter:</p> <pre><code> _99&amp;".;._2 freads 'myfile.txt' </code></pre> <p>It is better to use <a href="http://www.jsoftware.com/help/dictionary/d601.htm" rel="nofollow" title="Numbers">Numbers</a> (dyadic <code>".</code>) to convert literals to numeric rather than <a href="http://www.jsoftware.com/help/dictionary/d601.htm" rel="nofollow" title="Do">Do</a> (monadic <code>".</code>). This avoids the potential security issue of "executing" code in the file and will correctly convert more variations, compare the following:</p> <pre><code> ". '45 -34' NB. monadic ". 11 _99 ". '45 -34' NB. dyadic ". 45 _34 </code></pre> <p>You may find the following faster:</p> <pre><code> _99 ". ];._2 freads 'myfile.txt' </code></pre> <p><code>Numbers</code> is acting on the whole array at once rather than being run on each line individually.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload