In a recent script i've been working on, the data is all gone, but the file size is still what it was before the data was missing. When I open my script through notepad++ it reads all the data as NUL. How do I recover my missing code in my .py file?
Related
I have to convert .xls or .xlxs file to .csv file without using plugins or tools using Unix Command
Is their any way to do this ?
I Tried to do like this below ...But not working
Change the characterSet code from .xls file to UTF-8 encoding
Then create file again with extension change
cp temp.xls temp.csv
It is possible, but you need to realise that an *.xls file is a zipped directory structure (just unzip such a file, using Winzip or 7-zip). The unzipping can also be done using UNIX commands.
But what then? The directory structure is quite complicated to understand, and in order to create a script or a program which can do this (without using any external tools) is a tremendous work, so I'd propose you, either to use external tools anyway, or to make sure the files you receive already are CSV format.
I have several xls files I need to read in and combine into one dataframe. I try
df <- readxl::read_excel("file.xls")
or
df <- readxl::read_xls("file.xls")
but neither works. I get the following error
Error:
filepath: /Users/.../.../file.xls
libxls error: Unable to open file
I believe the issue is that every time I open the file in Excel, I am asked if I trust this file before I can open it. Is there anyway around it?
I also am operating on a mac, and I want to avoid library(xlsx) or other packages that have Java dependencies.
UPDATE: I had the idea of just going into each file to click "Save As..." and change the format to xlsx instead of xls, but the default file format that showed was an Excel 2004 XML Spreadsheet (.xml). Does that suggest that my file is actually a xml file even though the extension in the name is .xls?
I can't get write.csv or write.table to work in the r editor of BlueSky Statistics.
I usually just use this format in RStudio and it works perfectly.
write.csv(df, "zzz.csv")
Any hints?"
The default install location for BlueSky Statistics is 'C:\Program Files', where by default, there is no write permission (for creating or deleting files). Also, saving a file in the install location is not safe, as the file may get lost/deleted when the application is uninstalled. So it is always good to save your file(s) in your own folder(s) where you also have write permission.
In short, try to provide a writable location/path in write.csv() or other similar functions/commands.
See example below:
To save your file to the Desktop folder.
write.csv(df, "C:/Users/<YourUsername>/Desktop/zzz.csv")
Note: use forward slash(/) as a path separator.
Newbie R question: I have been trying to test the R script posted in FlowingData, but the script spit out the following error:
Error: XML content does not seem to be XML: 'NA'
I am running R on my windows box, with the .gpx files in the same directory as the script. Any help is appreciated.
Not sure if you ever found the answer to this or not, but the XML error relates to the fact that R does not know where your .gpx files are. While the FlowingData script indicates that the script will work if the .gpx files are in the same folder as your saved R script copy/pasted from FlowingData, that is not true. You must also set your working directory to this path as well, then R will see your .gpx files. If you FlowingData R script file and .gpx files are in: C:\Users\leon\Documents\R then add this line under the library(plotKML) line to set your working directory: setwd("C:\\Users\\leon\\Documents\\R")
Another word of note, make sure you only use the RunKeeper gpx files for a fairly small geographic area or the plotted data will be insanely small.
I've been using LinqToExcel to parse an exel document for a while and suddenly it's stoped working.
I'm getting the following error:
External table is not in the expected format.
Any ideas why this is happening? Or how to fix?
if (File.Exists(filenameFull))
{
var excel = new ExcelQueryFactory(filenameFull);
IList<Row> scanningRangesRows =
excel.Worksheet("B - Scanning Ranges").ToList();
I was using version LinqToExcel 1.6.3, when the problem started happening I updated to the latest version LinqToExcel 1.6.6 to no avail.
I've just noticed that the file I'm downloading is significantly smaller than previous verisons. I opened it in notepad and I can see [Content_Types].xml amongst the binary data. So it appears that the data source is now being saved as an xml represention of the xls file with the same extension. When I open the same file manually in Excel it popup with
The file you are trying to open '', is in a different format
than specified by the file extension. Verify that the file is from a
trusted source before opening the file. Do you want to open the file
now?
On clicking yes the file still opens and looks the same as previous versions.
It's probably something to do with the file.
Maybe it's being saved as an .xlsx type of file. Can you try renaming the file extenstion to .xlsx and see if that works.