Skip to content
Back to formatted view

Raw Message

Message-ID: <CAM_vjumFHgptyJQP+Z=XcOdqHx_u7yaYd0vHJB=9L0Lf0XRgVw@mail.gmail.com>
Date: 2011-11-17T14:47:34Z
From: Sarah Goslee
Subject: how to read a freetext line ?
In-Reply-To: <CAMUSh4rgmD4L1sbQp8RzdTD27ezrGyEFDm5zYHJhMAcG-duRTA@mail.gmail.com>

Hi,

On Thu, Nov 17, 2011 at 9:37 AM, Jie TANG <totangjie at gmail.com> wrote:
> hi everyone .
> ?Here I have a text where there are some integer and string variables.But I
> can not read them by readLines and scan

I've seen this question several times this morning. If that's you,
please do not post multiple times. If you haven't gotten an answer in
a couple days, then it's okay to ask again, but the trouble is usually
with your question, like here.

> the text is :
>
> weight ;30;130
> food:2;1;12
> color:white;black
>
> the first column is the names of the variables and others are the value of
> them.
> ?the column in different line are different.
> Can anyone help me ?

What have you tried?
What format do you need? For instance, reading them in as a single
string is easy. Using strsplit() to separate that single string into
several strings is easy. But without knowing what you are trying to
achieve, there's really no way to help you beyond suggesting those two
functions.

Sarah
-- 
Sarah Goslee
http://www.functionaldiversity.org