The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Re: help! to input data...
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Jason Welter

Posts: 4
Registered: 12/7/04
Re: help! to input data...
Posted: Jun 16, 1996 2:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <4pit53$>, says...
>well, silly me.
>I thought i was pretty good at the basics of mathematica, but today i
>tried to input some numerical data that was comma delimited. i.e.
>it is a large data file (10Mb+) with 5 numbers per line. i can't
>convert the commas to tabs easily.

You don't need to convert the commas to tabs.

Solution #1: Open the file and put a "{" before the first number
and a "}" after the last. This creats one big list and can be
read in using something like data = <<"C:\\temp\\data.txt";

Solution #2: Load the file into MS Word and insert "{{" before the
first number and add a "}}" after the last. Do a global search
and replace of the paragraph character with "},^P{" where ^P is
the paragraph character. This creats an array and can be
read in using something like data = <<"C:\\temp\\data.txt";
This preserves the structure of the data file, the first line of
data becomes record #1 data[[1]], the second number of the fifth
record is data[[5,2]]. You may need to clean up the end of the
file with your work processor.

I know there are ways to read almost anything in using ReadList
but quickly editing my data files with Excel and Work is a very
fast and easy to remember way to fix data access in Mathematica.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.