Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: How to read a data file in text format?_from a new learner

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62387] Re: [mg62377] Re: How to read a data file in text format?_from a new learner
  • From: George Woodrow III <georgevw3 at mac.com>
  • Date: Wed, 23 Nov 2005 01:12:04 -0500 (EST)
  • References: <200511220942.EAA23729@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Make sure you don't have the comma separating thousands in your data.  
Otherwise CSV will not work.

george

On Nov 22, 2005, at 4:42 AM, Bill Rowe wrote:

> On 11/21/05 at 3:54 AM, yanshanguke at 163.com (deepthinker) wrote:
>
>> I want to import a data file that produced by spectrometer into
>> mathemathica and fit the data. The file is in text format
>> ("data.txt"). The data in the file is characters: first line:some
>> descriptions. second line: 200, 45.5. third line: 201,44.3. and so
>> on. If you open the file "data.txt", you will see:
>
>> transmission ratio by UV-3150
>> 200, 45.5
>> 201,44.3
>> 202,44.6
>> 203,46.7
>> ....
>> 1,000,75.5
>> 1,000,76.3
>
>> How to import these data in to mathematica 5.0 and plot the figure?
>
> Probably the simplest way to deal with this file would be to use  
> Import. That is:
>
> data=Cases[Import["data.txt", "CSV"], {_?NumberQ,_?NumberQ}];
> ListPlot[data];
>
> Should do what you want.
> --
> To reply via email subtract one hundred and four
>


  • Prev by Date: Time needed for calculation
  • Next by Date: Re: Lost connection to license server
  • Previous by thread: Re: How to read a data file in text format?_from a new learner
  • Next by thread: Re: How to read a data file in text format?_from a new learner