Fwd: problem importing apparently common txt files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: problem importing apparently common txt files

zuzana zajkova
Dear list,

I would like to import into R studio txt files coming from Adobe photoshop.
These files contain different measures. The files are apparently common txt
files with columns separate by tab.  However with common function
read.table the import process doesn't work and weird symbols appear once
imported.  An example file is attached.

Do you have any idea what it is happening?

Thank you in advance

Zuzana



Here just a view of a file.
"Documento"    "Longitud"    "Ángulo"    "Área"    "Altura"    "Anchura"
"6143066.17.4.12.DSC_0001.png"    "8.832613"    "-90.000000"
"6143066.17.4.12.DSC_0001.png"    "8.937918"    "90.337288"
"6143066.17.4.12.DSC_0001.png"            "551.103109"    "16.736842"
"52.543860"
"6143066.17.4.12.DSC_0002.png"    "8.942544"    "-89.662891"
"6143066.17.4.12.DSC_0002.png"    "8.994992"    "-90.000000"
"6143066.17.4.12.DSC_0002.png"            "550.146507"    "16.736842"
"52.491228"
"6106937.17.4.12.DSC_0004.png"    "12.159715"    "-89.008611"

______________________________________________
[hidden email] 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.

folder2.txt (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: problem importing apparently common txt files

arun kirshna
Hi,

Check if this works:
 dat1 <- read.table("folder2.txt", header=TRUE,stringsAsFactors=FALSE,sep="\t",fileEncoding="UTF-16")


'data.frame':    79 obs. of  6 variables:
 $ Documento: chr  "6143066.17.4.12.DSC_0001.png" "6143066.17.4.12.DSC_0001.png" "6143066.17.4.12.DSC_0001.png" "6143066.17.4.12.DSC_0002.png" ...
 $ Longitud : num  8.83 8.94 NA 8.94 8.99 ...
 $ Ángulo   : num  -90 90.3 NA -89.7 -90 ...
 $ Área     : num  NA NA 551 NA NA ...
 $ Altura   : num  NA NA 16.7 NA NA ...
 $ Anchura  : num  NA NA 52.5 NA NA ...



A.K.


On Thursday, May 22, 2014 9:11 AM, zuzana zajkova <[hidden email]> wrote:
Dear list,

I would like to import into R studio txt files coming from Adobe photoshop.
These files contain different measures. The files are apparently common txt
files with columns separate by tab.  However with common function
read.table the import process doesn't work and weird symbols appear once
imported.  An example file is attached.

Do you have any idea what it is happening?

Thank you in advance

Zuzana



Here just a view of a file.
"Documento"    "Longitud"    "Ángulo"    "Área"    "Altura"    "Anchura"
"6143066.17.4.12.DSC_0001.png"    "8.832613"    "-90.000000"
"6143066.17.4.12.DSC_0001.png"    "8.937918"    "90.337288"
"6143066.17.4.12.DSC_0001.png"            "551.103109"    "16.736842"
"52.543860"
"6143066.17.4.12.DSC_0002.png"    "8.942544"    "-89.662891"
"6143066.17.4.12.DSC_0002.png"    "8.994992"    "-90.000000"
"6143066.17.4.12.DSC_0002.png"            "550.146507"    "16.736842"
"52.491228"
"6106937.17.4.12.DSC_0004.png"    "12.159715"    "-89.008611"
______________________________________________
[hidden email] 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.


______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Fwd: problem importing apparently common txt files

zuzana zajkova
Thank you! It seems to work.

Zuzana

On 22 May 2014 15:47, arun <[hidden email]> wrote:

> Hi,
>
> Check if this works:
>  dat1 <- read.table("folder2.txt",
> header=TRUE,stringsAsFactors=FALSE,sep="\t",fileEncoding="UTF-16")
>
>
> 'data.frame':    79 obs. of  6 variables:
>  $ Documento: chr  "6143066.17.4.12.DSC_0001.png"
> "6143066.17.4.12.DSC_0001.png" "6143066.17.4.12.DSC_0001.png"
> "6143066.17.4.12.DSC_0002.png" ...
>  $ Longitud : num  8.83 8.94 NA 8.94 8.99 ...
>  $ Ángulo   : num  -90 90.3 NA -89.7 -90 ...
>  $ Área     : num  NA NA 551 NA NA ...
>  $ Altura   : num  NA NA 16.7 NA NA ...
>  $ Anchura  : num  NA NA 52.5 NA NA ...
>
>
>
> A.K.
>
>
> On Thursday, May 22, 2014 9:11 AM, zuzana zajkova <[hidden email]>
> wrote:
> Dear list,
>
> I would like to import into R studio txt files coming from Adobe photoshop.
> These files contain different measures. The files are apparently common txt
> files with columns separate by tab.  However with common function
> read.table the import process doesn't work and weird symbols appear once
> imported.  An example file is attached.
>
> Do you have any idea what it is happening?
>
> Thank you in advance
>
> Zuzana
>
>
>
> Here just a view of a file.
> "Documento"    "Longitud"    "Ángulo"    "Área"    "Altura"    "Anchura"
> "6143066.17.4.12.DSC_0001.png"    "8.832613"    "-90.000000"
> "6143066.17.4.12.DSC_0001.png"    "8.937918"    "90.337288"
> "6143066.17.4.12.DSC_0001.png"            "551.103109"    "16.736842"
> "52.543860"
> "6143066.17.4.12.DSC_0002.png"    "8.942544"    "-89.662891"
> "6143066.17.4.12.DSC_0002.png"    "8.994992"    "-90.000000"
> "6143066.17.4.12.DSC_0002.png"            "550.146507"    "16.736842"
> "52.491228"
> "6106937.17.4.12.DSC_0004.png"    "12.159715"    "-89.008611"
> ______________________________________________
> [hidden email] 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.
>
>
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.