       Re: Importing and manipulating text files

• To: mathgroup at smc.vnet.net
• Subject: [mg83506] Re: Importing and manipulating text files
• From: Szabolcs Horvát <szhorvat at gmail.com>
• Date: Wed, 21 Nov 2007 05:58:43 -0500 (EST)
• References: <fi0peu\$6cl\$1@smc.vnet.net>

```jpalko at andrew.cmu.edu wrote:
> I have a a large text file saved in notepad that i would like to
> import into Mathematica and break up by columns.  I am able to import
> the file but I have no idea how to break up the data.  The data is
> seperated by commas.  In Mathematica the data comes in as a table with
> 5 places {1,2,3,4,5}. There are about 2500 data sets of this.  I would
> like to take the specific place value from each data set ({1,2,3,4,5})
> and make a column of data mathematica can use.  For example, I would
> like to take the the second value from all 2500 data sets and turn it
> into a seperate list of data. I am not sure if this is possible.  Does
> anyone have any experience with this?  Thanks.
>

Of course it it possible.  Here are a few examples:

In:= data = {{a, b, c}, {1, 2, 3}, {x, y, z}, {9, 8, 7}}
Out= {{a, b, c}, {1, 2, 3}, {x, y, z}, {9, 8, 7}}

In:= data[]
Out= {x, y, z}

In:= data[[3, 1]]
Out= x

In:= data[[All, 1]]
Out= {a, 1, x, 9}

In:= Transpose[data]
Out= {{a, 1, x, 9}, {b, 2, y, 8}, {c, 3, z, 7}}

In:= Transpose[data][]
Out= {a, 1, x, 9}

--
Szabolcs

```

• Prev by Date: Re: StringInput Question
• Next by Date: Re: Copy and Pasting Tables into Spreadsheet
• Previous by thread: Importing and manipulating text files
• Next by thread: Bug with LaplaceTransform?