I was not clear on exactly what you want to do.  I assume that you want to
automate the process given 120 file names.  Here is part of a script that
will parse the file names and give you the output file you want.  If it is
something different, then clarify your request:

> input <- "C:/RHTests/data/tmax/00032015tmax.csv"
> # parse off the file name
> x <- sub(".*/(.*)", "\\1", input)
> x
[1] "00032015tmax.csv"
> # strip off the leading numbers
> num <- sub("([[:digit:]]+).*", "\\1", x)
> # remove leading zeros and combine back with path
> path <- sub("(.*/).*", "\\1", input)
> output <- paste0(path, as.integer(num), "tmx")
> output
[1] "C:/RHTests/data/tmax/32015tmx"



2013/7/15 RODRIGUEZ MORENO VICTOR MANUEL <rodriguez.vic...@inifap.gob.mx>

> Hello everyone on the list
> I want to run a FindU function on as many files as  in a directory. Due of
> my limitations on data management I am calling the function, wait until
> finish the process, call for the next file and so on. I have almost 120 CSV
> files on the same directory. This the example of calling the function
>
> FindU(InSeries="C:/RHTests/data/tmax/00032015tmax.csv",
> MissingValueCode="-99.9", p.lev=0.95, Iadj=10000, Mq=10, Ny4a=0,
> output="C:/RHTests/data/tmax/32015tmx")
> As you can see my input file is "00032015tmax.csv" and my output file is
> "32015tmx".
> Any suggestions? Thanks a lot in advance
>
>
> Dr Victor M Rodríguez M
> Doctor en Ciencias, en Ciencias de la Tierra / Geociencias Ambientales
> INIFAP. CEPAB. (465) 9580167 y 86 Ext 108 y 220
>
> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> Este msg y su(s) atado(s) tiene carácter de "CONFIDENCIAL" y solo es para
> los fines descritos en su contenido. Queda expresamente prohibida bajo la
> ley de protección de datos del Gobierno de los Estados Unidos Mexicanos y
> para su difusion o extensión a terceros, se requiere del consentimiento
> expresso del titular de la cuenta de correo electrónico y/o del
> administrador del sitio en extenso de sus responsabilidades .
>
> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>


-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to