Re: How to read a data file in text format?_from a new learner
- To: mathgroup at smc.vnet.net
- Subject: [mg62379] Re: [mg62334] How to read a data file in text format?_from a new learner
- From: ggroup at sarj.ca
- Date: Tue, 22 Nov 2005 04:42:30 -0500 (EST)
- References: <200511210854.DAA22074@smc.vnet.net>
- Reply-to: ggroup at sarj.ca
- Sender: owner-wri-mathgroup at wolfram.com
On Monday, November 21, 2005 at 03:54 GMT -0500, Deepthinker wrote:
<snip>
> 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:
<snip>
> How to import these data in to mathematica 5.0 and plot the figure?
It should be fairly simple in this case:
data=Import["<path>\\data.txt","CSV"];
ListPlot[Rest[data]];
There are many options to ListPlot that will allow you to format the
resulting plot to a format that you desire. For example:
ListPlot[Rest[data],
Frame -> True,
Axes -> False,
PlotJoined -> True,
FrameLabel -> {"Wavelength", "Detector Reading"},
PlotLabel -> data[[1, 1]]]
- References:
- How to read a data file in text format?_from a new learner
- From: "deepthinker" <yanshanguke@163.com>
- How to read a data file in text format?_from a new learner