<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, ... import data from a .txt file?</title>
    <link>http://www.mapleprimes.com/questions/39314--Import-Data-From-A-txt-File</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 09 Jun 2026 07:17:07 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 07:17:07 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, ... import data from a .txt file?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, ... import data from a .txt file?</title>
      <link>http://www.mapleprimes.com/questions/39314--Import-Data-From-A-txt-File</link>
    </image>
    <item>
      <title>I just have seen, that the</title>
      <link>http://www.mapleprimes.com/questions/39314--Import-Data-From-A-txt-File?ref=Feed:MaplePrimes:... import data from a .txt file?:Comments#answer71551</link>
      <itunes:summary>I just have seen, that the copied and pasted text lost it's formation here in the post:

So the "Columns" are well structured, number under number - but it arent columns in the sense of a Excel file or something, its just a .txt file, with spaces inbetween.

I could also uload the file in the webb if some1 wants to try it for me.</itunes:summary>
      <description>I just have seen, that the copied and pasted text lost it's formation here in the post:

So the "Columns" are well structured, number under number - but it arent columns in the sense of a Excel file or something, its just a .txt file, with spaces inbetween.

I could also uload the file in the webb if some1 wants to try it for me.</description>
      <guid>71551</guid>
      <pubDate>Thu, 22 May 2008 20:48:51 Z</pubDate>
      <itunes:author>Britzel</itunes:author>
      <author>Britzel</author>
    </item>
    <item>
      <title>readdata</title>
      <link>http://www.mapleprimes.com/questions/39314--Import-Data-From-A-txt-File?ref=Feed:MaplePrimes:... import data from a .txt file?:Comments#answer71550</link>
      <itunes:summary>&lt;p&gt;Gernot,&lt;/p&gt;
&lt;p&gt;Please see ?readdata.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;J. Tarr&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Gernot,&lt;/p&gt;
&lt;p&gt;Please see ?readdata.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;J. Tarr&lt;/p&gt;</description>
      <guid>71550</guid>
      <pubDate>Thu, 22 May 2008 21:07:42 Z</pubDate>
      <itunes:author>Mariner</itunes:author>
      <author>Mariner</author>
    </item>
    <item>
      <title>hi there, thx for</title>
      <link>http://www.mapleprimes.com/questions/39314--Import-Data-From-A-txt-File?ref=Feed:MaplePrimes:... import data from a .txt file?:Comments#answer71549</link>
      <itunes:summary>hi there, thx for answer,

Doesn't help that much yet ;).   I allready found the Data Import assistant, but all the options i can choose there don't tell me uch, as i am not familiar with all this datatype stuff.

What i have is a normal .txt file. They are in a sort of ordered form. Between the 1st and the 2nd column there are 5 "spaces", between the 2nd and the 3rd there are 3 "spaces".
But thats all then.
But i allready tried to make a table out of it in Numbers (thats the analogon to Excel on a Mac). I couldn't find out how to devide it into 3 columns yet..  any1 knows?

Or maybe any1 knows that in Excel? I could use my Fathers PC for that then.

hi Mariner.  didn't see your post at first.  I will check that ?readdata     thx!</itunes:summary>
      <description>hi there, thx for answer,

Doesn't help that much yet ;).   I allready found the Data Import assistant, but all the options i can choose there don't tell me uch, as i am not familiar with all this datatype stuff.

What i have is a normal .txt file. They are in a sort of ordered form. Between the 1st and the 2nd column there are 5 "spaces", between the 2nd and the 3rd there are 3 "spaces".
But thats all then.
But i allready tried to make a table out of it in Numbers (thats the analogon to Excel on a Mac). I couldn't find out how to devide it into 3 columns yet..  any1 knows?

Or maybe any1 knows that in Excel? I could use my Fathers PC for that then.

hi Mariner.  didn't see your post at first.  I will check that ?readdata     thx!</description>
      <guid>71549</guid>
      <pubDate>Thu, 22 May 2008 21:17:05 Z</pubDate>
      <itunes:author>Britzel</itunes:author>
      <author>Britzel</author>
    </item>
    <item>
      <title>Say your data look like</title>
      <link>http://www.mapleprimes.com/questions/39314--Import-Data-From-A-txt-File?ref=Feed:MaplePrimes:... import data from a .txt file?:Comments#answer71547</link>
      <itunes:summary>&lt;pre&gt;
Say your data look like this (with non-constant spacing, but 3 for each line):
&lt;/pre&gt;
&lt;pre&gt;
&amp;nbsp;1&amp;nbsp;&amp;nbsp; 15.0000&amp;nbsp;&amp;nbsp; 1.120000E+02
2&amp;nbsp;&amp;nbsp; 15.0003&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.460000E+02
3 15.0006 1.140000E+02
4 15.0008 1.340000E+02
5 15.0011 6.600000E+01
6 15.0014 1.100000E+02
7 15.0017 1.370000E+02
8 15.0019 6.000000E+01
9&amp;nbsp;&amp;nbsp; 15.0022&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9.200000E+01
10 15.0025 5.200000E+01
53197 39.9963 9.000000E+01
53198 39.9971 9.900000E+01
53199 39.9978 3.000000E+01
53200 39.9985 4.900000E+01
53201 39.9993 1.330000E+02
&lt;/pre&gt;
&lt;pre&gt;
and that they are stored in a file data.txt.
&lt;/pre&gt;
&lt;pre&gt;
Then you write
&lt;/pre&gt;
&lt;pre&gt;
&amp;nbsp; fd := fopen(dataFile,READ,TEXT):
&amp;nbsp; theData:=readdata(fd, 3): # 3 columns
&amp;nbsp; fclose(fd):
&lt;/pre&gt;
&lt;pre&gt;
These are 15 tuples:
&lt;/pre&gt;
&lt;pre&gt;
nData:=nops(theData);
&lt;/pre&gt;
&lt;pre&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nData := 15
&lt;/pre&gt;
&lt;pre&gt;
Showing them you can use 'print(theData)' or convert(theData, listlist), working with them
may be best by using 'convert(theData, Array)'&amp;nbsp; or 'convert(%,Array, (datatype = float[8]))'
&lt;/pre&gt;</itunes:summary>
      <description>&lt;pre&gt;
Say your data look like this (with non-constant spacing, but 3 for each line):
&lt;/pre&gt;
&lt;pre&gt;
&amp;nbsp;1&amp;nbsp;&amp;nbsp; 15.0000&amp;nbsp;&amp;nbsp; 1.120000E+02
2&amp;nbsp;&amp;nbsp; 15.0003&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.460000E+02
3 15.0006 1.140000E+02
4 15.0008 1.340000E+02
5 15.0011 6.600000E+01
6 15.0014 1.100000E+02
7 15.0017 1.370000E+02
8 15.0019 6.000000E+01
9&amp;nbsp;&amp;nbsp; 15.0022&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9.200000E+01
10 15.0025 5.200000E+01
53197 39.9963 9.000000E+01
53198 39.9971 9.900000E+01
53199 39.9978 3.000000E+01
53200 39.9985 4.900000E+01
53201 39.9993 1.330000E+02
&lt;/pre&gt;
&lt;pre&gt;
and that they are stored in a file data.txt.
&lt;/pre&gt;
&lt;pre&gt;
Then you write
&lt;/pre&gt;
&lt;pre&gt;
&amp;nbsp; fd := fopen(dataFile,READ,TEXT):
&amp;nbsp; theData:=readdata(fd, 3): # 3 columns
&amp;nbsp; fclose(fd):
&lt;/pre&gt;
&lt;pre&gt;
These are 15 tuples:
&lt;/pre&gt;
&lt;pre&gt;
nData:=nops(theData);
&lt;/pre&gt;
&lt;pre&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nData := 15
&lt;/pre&gt;
&lt;pre&gt;
Showing them you can use 'print(theData)' or convert(theData, listlist), working with them
may be best by using 'convert(theData, Array)'&amp;nbsp; or 'convert(%,Array, (datatype = float[8]))'
&lt;/pre&gt;</description>
      <guid>71547</guid>
      <pubDate>Thu, 22 May 2008 21:48:20 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
    <item>
      <title>readdata example</title>
      <link>http://www.mapleprimes.com/questions/39314--Import-Data-From-A-txt-File?ref=Feed:MaplePrimes:... import data from a .txt file?:Comments#answer71548</link>
      <itunes:summary>&lt;p&gt;Gernot,&lt;/p&gt;
&lt;p&gt;Here's an example of using readdata to read in part of your text file, assuming that its Windows path is C:\Maths\Maths11 and its name is example.txt&lt;/p&gt;
&lt;p&gt;restart;&lt;br /&gt;
readdata(&amp;quot;C:\\Maths\\Maths 11\\example.txt&amp;quot;,[integer,float,float]);&lt;br /&gt;
&amp;nbsp;[[1, 15.0000, 112.0000], [2, 15.0003, 146.0000], [3, 15.0006, 114.0000], &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; [4, 15.0008, 134.0000], [5, 15.0011, 66.00000], [6, 15.0014, 110.0000], &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; [7, 15.0017, 137.0000], [8, 15.0019, 60.00000], [9, 15.0022, 92.00000], &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; [10, 15.0025, 52.00000]]&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;p&gt;J. Tarr&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Gernot,&lt;/p&gt;
&lt;p&gt;Here's an example of using readdata to read in part of your text file, assuming that its Windows path is C:\Maths\Maths11 and its name is example.txt&lt;/p&gt;
&lt;p&gt;restart;&lt;br /&gt;
readdata(&amp;quot;C:\\Maths\\Maths 11\\example.txt&amp;quot;,[integer,float,float]);&lt;br /&gt;
&amp;nbsp;[[1, 15.0000, 112.0000], [2, 15.0003, 146.0000], [3, 15.0006, 114.0000], &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; [4, 15.0008, 134.0000], [5, 15.0011, 66.00000], [6, 15.0014, 110.0000], &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; [7, 15.0017, 137.0000], [8, 15.0019, 60.00000], [9, 15.0022, 92.00000], &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; [10, 15.0025, 52.00000]]&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;p&gt;J. Tarr&lt;/p&gt;</description>
      <guid>71548</guid>
      <pubDate>Thu, 22 May 2008 21:49:17 Z</pubDate>
      <itunes:author>Mariner</itunes:author>
      <author>Mariner</author>
    </item>
    <item>
      <title>Cannot make it work!</title>
      <link>http://www.mapleprimes.com/questions/39314--Import-Data-From-A-txt-File?ref=Feed:MaplePrimes:... import data from a .txt file?:Comments#answer71546</link>
      <itunes:summary>&lt;p&gt;Here is my *.txt file created in Excel&lt;/p&gt;
&lt;p&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 10,9&amp;nbsp;&amp;nbsp;&amp;nbsp; 118,81&lt;br /&gt;
2&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp; 144&lt;br /&gt;
3&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp; 225&lt;br /&gt;
4&amp;nbsp;&amp;nbsp;&amp;nbsp; 17,8&amp;nbsp;&amp;nbsp;&amp;nbsp; 316,84&lt;br /&gt;
5&amp;nbsp;&amp;nbsp;&amp;nbsp; 21,2&amp;nbsp;&amp;nbsp;&amp;nbsp; 449,44&lt;br /&gt;
6&amp;nbsp;&amp;nbsp;&amp;nbsp; 35,4&amp;nbsp;&amp;nbsp;&amp;nbsp; 1253,16&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The separator is the Tabulation.&amp;nbsp; When I want to import it in Maple, here is what I get:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; readdata(&amp;quot;D://Data//Data6//Data_plot1.txt&amp;quot;, float, 3);

[[1., 10.], [2., 12., 144.], [3., 15., 225.], [4., 17.], [5., 21.], [6., 35.]]

&lt;/pre&gt;
&lt;p&gt;As you can see, even if I tell Maple that they are floating numbers and that there is 3 columns, I get that strange result.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;p&gt;mario.lemelin@cgocable.ca&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Here is my *.txt file created in Excel&lt;/p&gt;
&lt;p&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 10,9&amp;nbsp;&amp;nbsp;&amp;nbsp; 118,81&lt;br /&gt;
2&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp; 144&lt;br /&gt;
3&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp; 225&lt;br /&gt;
4&amp;nbsp;&amp;nbsp;&amp;nbsp; 17,8&amp;nbsp;&amp;nbsp;&amp;nbsp; 316,84&lt;br /&gt;
5&amp;nbsp;&amp;nbsp;&amp;nbsp; 21,2&amp;nbsp;&amp;nbsp;&amp;nbsp; 449,44&lt;br /&gt;
6&amp;nbsp;&amp;nbsp;&amp;nbsp; 35,4&amp;nbsp;&amp;nbsp;&amp;nbsp; 1253,16&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The separator is the Tabulation.&amp;nbsp; When I want to import it in Maple, here is what I get:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; readdata(&amp;quot;D://Data//Data6//Data_plot1.txt&amp;quot;, float, 3);

[[1., 10.], [2., 12., 144.], [3., 15., 225.], [4., 17.], [5., 21.], [6., 35.]]

&lt;/pre&gt;
&lt;p&gt;As you can see, even if I tell Maple that they are floating numbers and that there is 3 columns, I get that strange result.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;p&gt;mario.lemelin@cgocable.ca&lt;/p&gt;</description>
      <guid>71546</guid>
      <pubDate>Thu, 22 May 2008 22:07:09 Z</pubDate>
      <itunes:author>lemelinm</itunes:author>
      <author>lemelinm</author>
    </item>
  </channel>
</rss>