hallo,
i have a problem reading in the above mentioned kind of a file.
does anybody know an easy way how to read it in?
i can save it as a text file that looks like:
Datum des Fixings
Restlaufzeit
1 Jahr
2 Jahre
3 Jahre
4 Jahre
5 Jahre
6 Jahre
7 Jahre
8 Jahre
9 Jahre
10 Jahre
12 Jahre
15 Jahre
13.01.06
2.819
2.983
3.073
3.137
3.194
3.247
3.302
3.355
3.409
3.459
3.548
3.649
12.01.06
2.847
3.013
3.102
3.164
3.217
3.268
3.322
3.373
3.426
3.475
3.564
3.665
...
after skipping the first four lines i want to read it in while the first 12
lines are the heades
the next is the date followed by the singel values...(these lines are always
repeated)
it is supposed to look like
1 2 3 4 5 6 7 8 9 10 12 15
datum1 a b c d e f g h i j k l
datum2 a b c d e f g h i j k l
...
i tried to read it in as a normal excel file but it didn??t work out the way
it was supposed to
thank you for helping!!!
stefan
Hi
your question is a bit cryptic. What file you want to read?
xls or some exported file from Excel?
There is many different ways how to read data into R.
See
read.table, RODBC, R data Import Export Manual....
I personally use
in Excel
select the data with header and
Ctrl-C
in R
myfile <- read.delim("clipboard")
HTH
Petr
On 19 Jan 2006 at 10:38, Stefan Semmeling wrote:
From: "Stefan Semmeling" <trittihn at web.de>
To: <r-help at stat.math.ethz.ch>
Date sent: Thu, 19 Jan 2006 10:38:18 +0100
Subject: [R] html excel file
> hallo,
>
> i have a problem reading in the above mentioned kind of a file.
> does anybody know an easy way how to read it in?
> i can save it as a text file that looks like:
>
> Datum des Fixings
> Restlaufzeit
>
>
> 1 Jahr
> 2 Jahre
> 3 Jahre
> 4 Jahre
> 5 Jahre
> 6 Jahre
> 7 Jahre
> 8 Jahre
> 9 Jahre
> 10 Jahre
> 12 Jahre
> 15 Jahre
> 13.01.06
> 2.819
> 2.983
> 3.073
> 3.137
> 3.194
> 3.247
> 3.302
> 3.355
> 3.409
> 3.459
> 3.548
> 3.649
> 12.01.06
> 2.847
> 3.013
> 3.102
> 3.164
> 3.217
> 3.268
> 3.322
> 3.373
> 3.426
> 3.475
> 3.564
> 3.665
> ...
>
> after skipping the first four lines i want to read it in while the
> first 12 lines are the heades the next is the date followed by the
> singel values...(these lines are always repeated)
>
> it is supposed to look like
>
> 1 2 3 4 5 6 7 8 9 10 12 15
> datum1 a b c d e f g h i j k l
> datum2 a b c d e f g h i j k l
> ...
>
> i tried to read it in as a normal excel file but it didn??t work out
> the way it was supposed to
>
> thank you for helping!!!
>
> stefan
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
Petr Pikal
petr.pikal at precheza.cz
Read ?scan very carefully and play with the settings. What makes your file difficult is that it is multi line, meaning that the headings have carriage returns between them instead of being one line separated with spaces or tabs or commas. Can you change the way the file is outputted? If not, you will have to play with scan to get the file in. Anything is possible, but it looks like it will be tricky. HTH, Roger On 1/19/06, Stefan Semmeling <trittihn@web.de> wrote:> > hallo, > > i have a problem reading in the above mentioned kind of a file. > does anybody know an easy way how to read it in? > i can save it as a text file that looks like: > > Datum des Fixings > Restlaufzeit > > > 1 Jahr > 2 Jahre > 3 Jahre > 4 Jahre > 5 Jahre > 6 Jahre > 7 Jahre > 8 Jahre > 9 Jahre > 10 Jahre > 12 Jahre > 15 Jahre > 13.01.06 > 2.819 > 2.983 > 3.073 > 3.137 > 3.194 > 3.247 > 3.302 > 3.355 > 3.409 > 3.459 > 3.548 > 3.649 > 12.01.06 > 2.847 > 3.013 > 3.102 > 3.164 > 3.217 > 3.268 > 3.322 > 3.373 > 3.426 > 3.475 > 3.564 > 3.665 > ... > > after skipping the first four lines i want to read it in while the first > 12 > lines are the heades > the next is the date followed by the singel values...(these lines are > always > repeated) > > it is supposed to look like > > 1 2 3 4 5 6 7 8 9 10 12 15 > datum1 a b c d e f g h i j k l > datum2 a b c d e f g h i j k l > ... > > i tried to read it in as a normal excel file but it didn“t work out the > way > it was supposed to > > thank you for helping!!! > > stefan > > ______________________________________________ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >[[alternative HTML version deleted]]
On Do, 19.01.2006, 10:38, Stefan Semmeling wrote:> hallo, > > i have a problem reading in the above mentioned kind of a file.One way of transferring data between R and Excel is using the RExcel package contained in R(D)COM server available from CRAN in category Other. The package rcom (available from CRAN) can turn R into a COM server for Excel and with a little bit of VBA programming it is possible to transfer data both ways also.