Better importation of variables from .txt file
Storing the data in 18 independent variables is awkward.  The naming of your variables suggests that each group of six doubles represents an object, which I've called a Sexdoublet.

Throwing all the code into main() is poor practice; there should be a function to do the importing.  It should accept an istream parameter and return a vector of Sexdoublets.

I don't know what you were hoping to accomplish with if (!ifs) ifs &gt;&gt; trash; — if the ifstream is bad then you shouldn't try reading from it.

Hard-coding the filename is probably a bad idea.  I've used the convention of reading from either a file that is specified on the command line, or from standard input otherwise.

#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &lt;string.h&gt;
#include &lt;vector&gt;

/* A struct of six doubles */
struct Sexdoublet {
    double x, y, d, m, c, t;

    friend std::istream &amp;operator&gt;&gt;(std::istream &amp;in, Sexdoublet &amp;r) {
        return in &gt;&gt; r.x &gt;&gt; r.y &gt;&gt; r.d &gt;&gt; r.m &gt;&gt; r.c &gt;&gt; r.t;
    }

    friend std::ostream &amp;operator&lt;&lt;(std::ostream &amp;out, const Sexdoublet &amp;r) {
        return out &lt;&lt; "[ x = " &lt;&lt; r.x
                   &lt;&lt; ", y = " &lt;&lt; r.y
                   &lt;&lt; ", d = " &lt;&lt; r.d
                   &lt;&lt; ", m = " &lt;&lt; r.m
                   &lt;&lt; ", c = " &lt;&lt; r.c
                   &lt;&lt; ", t = " &lt;&lt; r.t &lt;&lt; " ]";
    }
};

std::vector&lt;Sexdoublet&gt; import(std::istream &amp;in) {
    std::vector&lt;Sexdoublet&gt; data;
    Sexdoublet s;
    while (in &gt;&gt; s) {
        data.push_back(s);
    }
    return data;
}

int main(int argc, char *argv[]) {
    // If the first command-line argument is not "-", treat it as the filename
    // from which to read the input.  Otherwise, read from STDIN.
    const char *filename = (argc &gt;= 2 &amp;&amp; 0 != strcmp("-", argv[1])) ?
                                argv[1] : NULL;
    std::ifstream f;
    std::istream &amp;in = filename ? (f.open(filename), f) : std::cin;
    if (!f) {
        std::cerr &lt;&lt; "Error opening " &lt;&lt; filename &lt;&lt; ": "
                  &lt;&lt; strerror(errno) &lt;&lt; std::endl;
        return 1;
    }

    std::vector&lt;Sexdoublet&gt; data = import(in);
    std::for_each(data.begin(), data.end(), [](const Sexdoublet &amp;s) {
        std::cout &lt;&lt; s &lt;&lt; std::endl;
    });
    return 0;
}