Skip to content

how to read a file containing a series filename

7 messages · Jie Tang, jim holtman, kees duineveld

#
This works fine for me; look at your options on 'scan':
+ H20100903.TXT
+ H20100904.TXT
+ H20100905.TXT
+ H20100906.TXT
+ H20100907.TXT
+ H20100908.TXT", what = '')
Read 7 items
Read 7 items
[1] "H20100902.TXT" "H20100903.TXT" "H20100904.TXT" "H20100905.TXT"
"H20100906.TXT"
[6] "H20100907.TXT" "H20100908.TXT"

        
On Wed, Mar 7, 2012 at 8:49 AM, Jie Tang <totangjie at gmail.com> wrote:

  
    
#
you have to tell 'scan' to read characters with

what = ''
On Wed, Mar 7, 2012 at 9:44 AM, Jie Tang <totangjie at gmail.com> wrote:

  
    
#
here is my file.txt that generated by other command "ls "

2012/3/7 Jie Tang <totangjie at gmail.com>

  
    
#
Hi Jie,

Are you looking for this construction?

mydata <- apply(c("H20100902.TXT", "H20100903.TXT" ,"H20100904.TXT"
,"H20100905.TXT", "H20100906.TXT",
"H20100907.TXT","H20100908.TXT"),function(x) scan(x, other options))

Kees
On Wed, Mar 7, 2012 at 3:44 PM, Jie Tang <totangjie at gmail.com> wrote: