MathGroup Archive 2009

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

Search the Archive

Re: importing fixed width data


On Mar 14, 6:42 am, swiftset <swift... at gmail.com> wrote:
> Hi, I'm trying to import data from a file where the fields are stored
> in a fixed width format. The Import["file", "Table"] command is the
> closest I can get to what I'd like, but then the data is divided using
> whitespace, so I get a lot of extraneous fields, and no way to tell
> whether what Mathematica imported as two fields is actually just one
> that contained a whitespace.
>
> Any ideas on how to proceed?

Some variation of:

ToExpression@StringTake[Import["file", "List"], <fieldSpecs>]

Vince Virgilio


  • Prev by Date: Re: setting discrete values for a function -- newbie
  • Next by Date: Re: setting discrete values for a function -- newbie
  • Previous by thread: Re: importing fixed width data
  • Next by thread: Two Notebooks Open at the Same Time