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: [mg62406] Re: [mg62359] Re: How to read a data file in text format?_from a new learner
  • From: gardyloo <gardyloo at mail.wsu.edu>
  • Date: Wed, 23 Nov 2005 01:12:35 -0500 (EST)
  • References: <dls56u$nue$1@smc.vnet.net> <200511220942.EAA23639@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

  Jeff,

     Thank you! I've been working with Mathematica for about six years,
getting progressively more advanced, and use SetDirectory and Import (or
ReadFile) all the time to work with data. Always, I've had the stupid
problem that I couldn't work with directories starting with "t", etc.,
and got around it by simply putting "x" in front of names, like
"xtankroom_data". I never would have thought that Mathematica parsed
those things expecting "tab" characters, etc. in directories.

    This won't save me significant time (though it would have, lo, about
five years ago), but it'll set my mind a little more at ease with what
crazy things go on behind the scenes.

          Curtis


jeff langston wrote:

>Hello!
>
>try something like this:
>
>transData = Rest[ Import["(directory file is in)/data.txt", "CSV"] ];
>
>If for example your file is in the folder C:\experimental data, don't use 
>"C:\experimental data\data.txt"
>
>Instead, use the following in the import command:
>"C:/experimental data/data.txt"
>
>The reason is that sometimes you can have directories/files starting with an 
>r or t or some other character where mathematica, for arguments in quotes, 
>interprets it differently than you would think, e.g., /t means tab, where \t 
>means just characters in a string.  It doesn't matter if the t or r was 
>buried, e.g.,  C:\Documents\trig stuff
>  
>


  • Prev by Date: Re: Confusing results with N[expr]?
  • Next by Date: Re: Re: How to View Mathematica and Hardcopy Books
  • Previous by thread: Re: How to read a data file in text format?_from a new learner
  • Next by thread: Re: Re: Re: How to read a data file in text format?_from a new learner