I'm running into a bit of a problem. I have multiple users reading and writing to the same excel file. When two people read the same file at the same time PHPexcel crashes. When saving sometimes it just doesn't save. Am I going to need to edit the PHPexcel library? I've read about flock for saving. Not sure, am I up a creek? Thanks
Related
The environment is:
R: 3.6.1
readxl version: ‘1.3.1’
When I close the Excel program, read_excel takes a second or 2, but when I have the file opened in Excel, then read_excel in R can take a few minutes.
I wonder why was that?
Some programs, like Excel, put access restrictions on files while the files are open. This prevents accidental conflicts from external changes to the same file while it is open.
I don't know why specifically it would affect other tools from reading the file and why the effect would manifest as slower speed instead of complete inability. Maybe Excel is trying to monitor the access to the file and compare it to the content it has loaded.
EDIT: This is only happening on PC! No such issue with a Mac reading data into R.
I have to read files that are being updated on a day-to-day basis and stored on a shared drive.
If I have an R session open in which one of these files has been read, the file cannot be saved with new edits until I close my R session.
Is there a way to read a file into R while still allowing others to save new edits through Excel?
Edit: I am using package xlsx and function read.xlsx.
Similar questions, but not the question I have, were around loading a file that someone saved as somefilename.RData. I am trying to do something different.
What I am trying to do is load the actual .RData file that gets saved from an R session. The context is that I am using 2 different computers and am trying to download the .RData file from one computer and then load this same .RData file on a different computer in RStudio.
When I download the .RData file it shows up without the “.” (e.g., it shows up as RData). When I try to rename it “.RData”, Windows will not allow me to do so.
Is there a way to do what I am trying to do?
Thanks!
After playing around with this, I was able to load the file (even though it was called “RData“ and not called “.RData”, by using RStudio by going to Session > Load Workspace... and then navigating to that file. I had used File > Open File... which did not work
I am using a GIS program called ArcGIS to create a .dbf file from shapefile data. I have tried opening the .dbf file in sqlite3. sqlite3 stated "Error: file is encrypted or is not a database". What is causing this error? Why can't I open the .dbf in sqlite3?
When I open the dbf file in Excel I have no issues.
Edit: I am new user to Stack Overflow. SO I am confused at why there no explaination for -1 Vote. What does it mean? And if I get no input into why down votes happen, how can I learn to write better questions?
Edit 2: Since getting an answer, I have researched more and understand better that dbf files are old format that has no SQL component to it. Originally I thought (wrongly) if dbf and sqlite are both databases then they must be compatible. When just starting out, basic questions to you may not be so basic to others.
A .dbf file is a dBase database file. SQLite is a different database system with a completely different database file format. SQLite clients are not made to handle .dbf files. So the behavior you see is expected.
If you really need to access this data with a SQLite client, you could use ArcGIS's Create SQLite Database tool and copy the data from the shapefile to a SQLite database.
So I did some research on checking an uploaded pdf for viruses and I found these 2 solutions:
Save the file to the hard disk, let the antivirus quarantine/delete it if it was infected, then check if the file still exists on the disk.
Use an antivirus that supports calling it through .net and scan the file
What I am thinking instead is to read the uploaded pdf file stream using something like iTextSharp then writing a new file but after stripping any macros.
One of the benefits would be making sure that the uploaded file is a pdf since it will be parsed by the iTextSharp, but would it also protect it from viruses?