MathGroup Archive 2007

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

Search the Archive

Re: comments in import files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74644] Re: comments in import files
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 29 Mar 2007 02:35:42 -0500 (EST)
  • References: <eudd45$sdc$1@smc.vnet.net>


Hi,

e.g. you could read the whole file as one string, delete empty 

lines,convert the string to a stream and read the stream like:

Import[StringToStream[yourString],"Table"]. However, I think an easier 

solution is to add the comment as an additional column and delete it 

after importing by:

t=Import[..];

t[[All,Range[number_of_columns]]]

this even works if not all lines have a comment.

Daniel



beheiger wrote:

> Hi,

> 

> I would like to know if Mathematica can handle comments in import files.

> In particular, I would like to add lines of comments to an 

> <emptyspace>-separated

> ASCII table (say, "results.dat") that I produced with other programs. 

> However,

> I can't seem to find anything on how to write these comments in such a way 

> that

> Mathematica's function, used as

> 

> Import["results.dat","Table"];

> 

> does not complain. Help is appreciated.

> 

> Regards, Andy 

> 

> 

> 




  • Prev by Date: Re: comments in import files
  • Next by Date: Re: comments in import files
  • Previous by thread: Re: comments in import files
  • Next by thread: Re: comments in import files