Converting .obj file to .sdkmesh using MeshConvert tool - directx-10

DirectX SDK provides a utility that converts .x or .obj file to .sdkmesh, its called meshconvert tool.
But, I tried many times and its not working.
It shows this message "Cannot Load specified input file"
(I input a .obj file named samp.obj and typed "meshconvert /sdkmesh samp.obj".)
Can anyone please help me solve it?
P.S. I'm on windows 7 and inputting the above command in DirectXSDK Command prompt.
Thanks in advance!

I have read that the .obj file type listed by MeshConvert.exe refers to a binary form of .x, not the popular Wavefront Object Model format. I'm still looking for a way to do this myself.

Related

Reading Excel: evaluation error with zip file cannot be opened [duplicate]

I am using R with readxl package. I try to import an Excel file with the following command:
library(readxl)
city_codes <- read_excel("./data/file.xlsx", sheet = "city_codes")
It says it is a zip file and cannot be opened:
Error in sheets_fun(path) :
Evaluation error: zip file './data/file.xlsx' cannot be opened.
Any ideas?
I had this error, but for me, it was just that I had the sheet open in Excel while trying to read it into R. I guess the package wrongly perceives it as a zip file when it's trying to read it while Excel has partial ownership of it (and this blocks the read).
The error message is readxl's funny way of saying "file not found". That exact line of code gives me the exact same error, and the file doesn't even exist for me.
Note: I'm on version 1.0.0 of readxl
For me the "Evaluation error: zip file" error message also appeared when the excel spreadsheet was still opened in MSExcel.
You can specify a path to a file, only if it is nested on the working directory.
For example: If your working directory is MyWD and there is a folder in it, named MyData and another folder within MyData named MyNestedData, and finally myExcelFile.xlsx
read_excel("MyData/MyNestedData/myExcelFile.xlsx",sheet = "Sheet2") #will work
read_excel("MyWD/MyData/MyNestedData/myExcelFile.xlsx",sheet = "Sheet2") #will not work
If your excel worksheet is password protected, read_excel won't be able to access it and will give you this error.
If it needs protection, I would suggest p/w protecting the folder it's in, and then unprotecting the worksheet.
You may also get this error if you are using the wrong read function.
For example, read_xlsx("file.xls" ...) will throw the error.
This can happen if you forget to do the following before you use the read_excel function
setwd("C:\\map\\map_in_map\\map_in_map_in_map_where_the_file_is")
Try to change file restrictions if you are working on company's computer. This worked for me to solve this issue.
You may try to specify the full path instead of ./path/to/file
Try to make a new file. click "save as" and make a new name. Run again your code. it worked well to me :)
Although the solution was already given, but for the sake of documentation I will leave my situation here:
I ran into the same problem and couldn't figure out why. It seems that my excel file had closed with an error or something similar. I had to open the excel file, and save it again. When I ran R, everything worked smoothly.
The issue was that there was hidden files inside my working directory. I copied them to outside and exclude all directories. Now it works when I run the code.
In my case the xlsx was created using Excel 2007, which caused this issue. Xlsx files from newer Excel versions work.
In my case the file was not visible in the directory although I had deleted it. I had to search for the file using a software called "Everyting" and I deleted it. After that it worked.
For me, I was downloading a file from Google Drive into a tempfile with extension .xlsx... Realised the file in Google Drive was .xls so I changed it to that and it worked. Kinda rare situation though.
I got the same error message.
In my case the line that worked properly specified the sheet by a string (copied from excel). Suddenly, it did not work anymore (with the mentioned error message). I tried several things explained here. Ended up specifying the sheet by its number in the excel file - worked!
read_xlsx("table.xlsx", sheet="name_of_sheet") # suddently corrupt
read_xlsx("table.xlsx", sheet=4) # works
Why? No update of the package or something. I dislike to have to use a less specific line.
UPDATE: Restarting the R session made the initial line work again (although, I HAD checked the wd before...)

PDF File Import R

I have multiple .pdf-files (stored in a local folder), that contain text. I would like to import the .pdf-files (i.e., the texts) in R. I applied the function 'read_dir' (R package: [textreadr][1])
library ("textreadr")
Data <- read_dir("<MY PATH>")
The function works well. BUT. For several files, that include special characters (i.e., letters) in their names (such as 'ć'; e.g., 'filenameć.pdf'), the function did not work (error message: 'The following files failed to read in and were removed:' …).
What can I do?
I tried to rename the files via R (did not work (probably due to the same reasons)). That might be a workaround.
I did not want to rename the files manually :)
Follow-Up (only for experts):
For several files, I got one of the following error messages (and I have no idea why):
PDF error: Mismatch between font type and embedded font file
or
PDF error: Couldn't find trailer dictionary
Any suggestions or hints how to solve this issue?
Likely the issue concerns the encoding of the file names. If you absolutely want to use R to rename the files for you, the function you want to use is iconv, determine the encoding of the file names and then convert them to utf-8.
However, a much better system would imply renaming them using bash from command line. Can you provide a more complete set of examples?

How to open .jl file

I want to open a .jl file and convert it to a readable file preferably in .xls format.
I do not have any any idea about Julia language.
Is there a file opener for jl files?
I came here with the same question, but since the file I was looking at was clearly JSON data, I did some more searching.
The .jl file extension also refers to JSON lines, sometimes instead a .jsonl extension.
More here: http://jsonlines.org/
You can search for .json to Excel to find a converter, e.g. https://json-csv.com/ (this worked fine on my JSON lines file).
A .jl file is a julia script.
It is source code.
Not data.
You can open it up in any text editor, e.g. notepad on windows.
However, it won't normally contain anything useful to you unless you want to edit that code.
(It might contain some array literals that you want, I guess)
Perhaps you mean to ask "How can I open a .jld file"?
Which is a julia HDF5 file.
In which case please ask another question.
As I see, Julia is a script language therefor the file can be opened in a text editor like Notepad++, Vim, etc. Do not use word processor (like LibreOffice Writer) if you want to modify it, but it's OK if you want to read only.
To get started:
https://docs.julialang.org/en/stable/

How to download and unzip a raster zipped file directly in r from github

I am trying to download 'Landsat.rar` file (included 6 Landsat bands) and unzip it directly in r, but It doesn't work as I expected. Thank you for your help!
library(raster)
ls_url<-"https://github.com/tuyenhavan/Landsat-Data/blob/LS7/Landsat.rar"
temp<-tempfile()
download.file(ls_url,temp)
unzip(temp,"tif$")
myls<-stack("tif$")
Especially if you are using Windows, it might be that you need to use the binary mode in download.file:
download.file(ls_url, temp, mode="wb")
otherwise the file gets corrupted.
Also, the URL you are using is incorrect. You used the one for the web interface. If you want to get the file itself you need to use (check the link associated with the "Download" button):
https://github.com/tuyenhavan/Landsat-Data/raw/LS7/Landsat.rar
Finally, unzip() doesn't know how to deal with rar archive files. If you created this archive yourself, use the zip format instead; or unrar the file with another program (that you could call from R using system()).

Reading Excel: evaluation error with zip file '..file.xlsx' cannot be opened

I am using R with readxl package. I try to import an Excel file with the following command:
library(readxl)
city_codes <- read_excel("./data/file.xlsx", sheet = "city_codes")
It says it is a zip file and cannot be opened:
Error in sheets_fun(path) :
Evaluation error: zip file './data/file.xlsx' cannot be opened.
Any ideas?
I had this error, but for me, it was just that I had the sheet open in Excel while trying to read it into R. I guess the package wrongly perceives it as a zip file when it's trying to read it while Excel has partial ownership of it (and this blocks the read).
The error message is readxl's funny way of saying "file not found". That exact line of code gives me the exact same error, and the file doesn't even exist for me.
Note: I'm on version 1.0.0 of readxl
For me the "Evaluation error: zip file" error message also appeared when the excel spreadsheet was still opened in MSExcel.
You can specify a path to a file, only if it is nested on the working directory.
For example: If your working directory is MyWD and there is a folder in it, named MyData and another folder within MyData named MyNestedData, and finally myExcelFile.xlsx
read_excel("MyData/MyNestedData/myExcelFile.xlsx",sheet = "Sheet2") #will work
read_excel("MyWD/MyData/MyNestedData/myExcelFile.xlsx",sheet = "Sheet2") #will not work
If your excel worksheet is password protected, read_excel won't be able to access it and will give you this error.
If it needs protection, I would suggest p/w protecting the folder it's in, and then unprotecting the worksheet.
You may also get this error if you are using the wrong read function.
For example, read_xlsx("file.xls" ...) will throw the error.
This can happen if you forget to do the following before you use the read_excel function
setwd("C:\\map\\map_in_map\\map_in_map_in_map_where_the_file_is")
Try to change file restrictions if you are working on company's computer. This worked for me to solve this issue.
You may try to specify the full path instead of ./path/to/file
Try to make a new file. click "save as" and make a new name. Run again your code. it worked well to me :)
Although the solution was already given, but for the sake of documentation I will leave my situation here:
I ran into the same problem and couldn't figure out why. It seems that my excel file had closed with an error or something similar. I had to open the excel file, and save it again. When I ran R, everything worked smoothly.
The issue was that there was hidden files inside my working directory. I copied them to outside and exclude all directories. Now it works when I run the code.
In my case the xlsx was created using Excel 2007, which caused this issue. Xlsx files from newer Excel versions work.
In my case the file was not visible in the directory although I had deleted it. I had to search for the file using a software called "Everyting" and I deleted it. After that it worked.
For me, I was downloading a file from Google Drive into a tempfile with extension .xlsx... Realised the file in Google Drive was .xls so I changed it to that and it worked. Kinda rare situation though.
I got the same error message.
In my case the line that worked properly specified the sheet by a string (copied from excel). Suddenly, it did not work anymore (with the mentioned error message). I tried several things explained here. Ended up specifying the sheet by its number in the excel file - worked!
read_xlsx("table.xlsx", sheet="name_of_sheet") # suddently corrupt
read_xlsx("table.xlsx", sheet=4) # works
Why? No update of the package or something. I dislike to have to use a less specific line.
UPDATE: Restarting the R session made the initial line work again (although, I HAD checked the wd before...)

Resources