I want to execute in Rstudio this powershell command
[System.IO.File]::ReadLines(".\Dropbox\TesisGrado\R_Data\rawdata\5.Azules\200 ppfd\65.dm68i.e.r.1.dat")
I've tried many ways like
system( "[System.IO.File]::ReadLines", input= ".\\65.dm68i.e.r.1.dat")
shell("[System.IO.File]::ReadLines", input= ".\\Dropbox\\TesisGrado\\R_Data\\rawdata\\5.Azules\\200\ ppfd\\65.dm68i.e.r.1.dat")
system("cmd.exe", input = paste("powershell [System.IO.File]::ReadLines(\".\\Dropbox\\TesisGrado\\R_Data\\rawdata\\5.Azules\\200\ ppfd\\65.dm68i.e.r.1.dat\")"))
system("cmd.exe", input = paste("powershell [System.IO.File]::ReadLines(\"65.dm68i.e.r.1.dat\")"))
Getting this kind of error
Microsoft Windows [Versi¢n 10.0.16299.192]
(c) 2017 Microsoft Corporation. Todos los derechos reservados.
C:\Users\Admin\Dropbox\TesisGrado\R_Data\rawdata\5.Azules\200 ppfd>powershell [System.IO.File]::ReadLines("65.dm68i.e.r.1.dat")
En l¡nea: 1 Car cter: 29
+ [System.IO.File]::ReadLines(65.dm68i.e.r.1.dat)
+ ~
Falta el par‚ntesis de cierre ')' en la llamada al m‚todo.
En l¡nea: 1 Car cter: 29
+ [System.IO.File]::ReadLines(65.dm68i.e.r.1.dat)
+ ~~~~~~~~~~~~~~~~~~
Token '65.dm68i.e.r.1.dat' inesperado en la expresi¢n o la instrucci¢n.
En l¡nea: 1 Car cter: 47
+ [System.IO.File]::ReadLines(65.dm68i.e.r.1.dat)
+ ~
Token ')' inesperado en la expresi¢n o la instrucci¢n.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingEndParenthesisInMethodCall
C:\Users\Admin\Dropbox\TesisGrado\R_Data\rawdata\5.Azules\200 ppfd>[1] 0
My current directory in Rstudio is C:/Users/Admin/Dropbox/TesisGrado/R_Data/rawdata/5.Azules/200 ppfd/
What i'm doing wrong? How can i read that file executing powershell command?
systemandsystem2do not deal well with arguments that have embedded spaces. I suggest using thepspackage.