MathGroup Archive 2007

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

Search the Archive

Re: comments in import files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74637] Re: comments in import files
  • From: "Rolf.Mertig at gmail.com" <Rolf.Mertig at gmail.com>
  • Date: Thu, 29 Mar 2007 02:32:06 -0500 (EST)
  • References: <eudd45$sdc$1@smc.vnet.net>

Hi,
here is one possibility:

In[3]:= !!t.txt
1 2 3
# a comment
4 5 6

In[3]:= Import["t.txt","Table"]/.{"#",___}:>Sequence[] // InputForm

Out[3]//InputForm= {{1, 2, 3}, {4, 5, 6}}

Rolf Mertig

http://www.gluonvision.com

On 28 Mrz., 11:39, "beheiger" <behei... at hotmail.com> 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: Is this a problem in mathematica?
  • Next by Date: Re: comments in import files
  • Previous by thread: RE: comments in import files
  • Next by thread: Re: comments in import files