Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing awk to process a database
    primarykey
    data
    text
    <p>I have a directory on my computer which contains an entire database I found online for my research. This database contains thousands of files, so to do what I need I've been looking into file i/o stuff. A programmer friend suggested using bash/awk. I've written my code:</p> <pre><code> #!/usr/bin/env awk ls -l|awk' BEGIN {print "Now running"} {if(NR == 17 / $1 &gt;= 0.4 / $1 &lt;= 2.5) {print $1 &gt; wavelengths.txt; print $2 &gt; reflectance.txt; print $3 &gt; standardDev.txt;}}END{print "done"}' </code></pre> <p>When I put this into my console, I'm already in the directory of the files I need to access. The data I need begins on line 17 of EVERY file. The data looks like this:</p> <pre><code>some number some number some number some number some number some number . . . . . . . . . </code></pre> <p>I want to access the data when the first column has a value of 0.4 (or approximately) and get the information up until the first column has a value of approximately 2.5. The first column represents wavelengths. I want to verify they are all the same for each file later, so I copy them into a file. The second column represents reflectance and I want this to be a separate file because later I'll take this information and build a data matrix from it. And the third column is the standard deviation of the reflectance. </p> <p>The problem I am having now is that when I run this code, I get the following error: No such file or directory</p> <p>Please, if anyone can tell me why I might be getting this error, or can guide me as to how to write the code for what I am trying to do... I will be so grateful.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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