While exporting an SPSS (.sav) data file to excel, the blank cells were imputed as #NULL! .Is there any way to overcome this?
Even, we can replace the #NULL! by find and replace in Excel, but i need to do this in SPSS end itself.
Please assist.
Regards
Satheeshkumar
You may consider saving a copy of your original spss file, and use the syntax command of changing the variables into strings... use alter type command. more details here: http://www.spss-tutorials.com/changing-variable-properties-3-type/
As i wrote, you probably save your file as csv. or excel file. If the variable is a string, it will output with non #NULL!, but when it is a numeric value, and the cell is empty, the excel shows the #NULL! character.
To exclude #NULL, we can export by .csv file, then save as by excel file.
It works.
Related
Using some combination of Win32::OLE, ParseExcel, WriteExcel...I want to be able to change the formatting of all of the cells in a column (or multiple columns, based on a condition) to be a custom date format, such as "yyyy-mm-dd h".
I have been able to use Win32::OLE to do a find and replace on an Excel file that I have open, but I am not sure the best way to reformat an entire column of cells. I imagine it will be something along the lines of parsing the file with ParseExcel, and using WriteExcel to overwrite the file after changing the format somehow.
Any advice would be greatly appreciated, cheers!
Don't overwrite, copy to a new name (then you can compare, and the process is reversable).
You would essentially copy all the cells, modifying only the ones you need to format change.
Excel Format Info - many examples for formatting time
I have a large data set in SPSS (v20) with null values for some observations.
I tried saving as an excel 2007 file, but when I open excel file "#NULL!" appears in cells where values are null. I'm going out of ram when trying to use 'find and replace' function in Excel.
T tried saving as a csv file then I got a space in the cells where values are null.
Could anybody advice on this please?
I typically save as CSV and then in excel save as .xlsx. All missing values are then, as you noted, allocated a space which I accept as representing sysmis values.
When I work with a file that has been saved directly to Excel, (ie many "#NULL" values), I use a VBA macros which does a find/replace row by row. The macro is quicker than doing it all at once as this typically starts to slow to infuriating speeds. The macro is still not as fast as one would want...which is why I go via CSV.
According to the command syntax reference, #NULL! values occur only for system missing values. So to prevent that you need to assign the system missings a value - for that you can use the RECODE command (e.g. RECODE MyVar (SYSMIS = -9)(ELSE = COPY). would work for a number field in which -9 can not be a valid value).
Depending on what you want the value to be when written to the sheet, you can then use the /CELLS=VALUES subcommand on SAVE TRANSLATE to save the assigned missing numeric category (IMO a bad idea for spreadsheets) or you can assign the missing value a VALUE LABELS and use /CELLS=LABELS to save the string label in the cell.
I have a spreadsheet that I need to convert into code. Is there a way to export the spreadsheet that keeps the formulas intact?
When I save it as any other format it converts the formulas to their values. For example, if I had =(4/2), the CSV would just put 2. Whereas I need the original formula. I have tried accessing the spreadsheet using PHP Excel also but it cannot load the spreadsheet due to size.
Simplest way is to do CTRL+` and then copy+paste to Notepad or wherever you want
I have an excel file and I exported the file into a pipe delimited csv file. However, in each row of the csv file, there are trailing pipes.
Here's a typical row:
dsad|asd|safd|sadaf| |||||||||
ddss|sd|saadfdaf|dadf |||||||||
Does anyone know how not to include those trailing pipes while exporting to csv from excel?
Thanks.
The sheet you are exporting probably contains cell that excel believes has values in them (I call them ghost cells). To prevent this behaviour, I have two suggestions:
Copy the spreadsheet to a fresh new spreasheet and export again. It should be fine.
Delete all the columns after the last column containing data (Do not use the Delete/Del key, select the columns till the end and use Ctrl+- instead). After this, save the workbook then export again.
If those don't work, there's probably some rows with actual data somewhere, and there, the data will be correctly delimited by the pipes. Might be best to count the number of columns of data that you have and make sure your resulting csv file has the same number of columns.
If this still doesn't work... just shout I guess? ^^;
After running a model in fortran (95) I end up with some result arrays (and one result matrix). I'd like to move these into excel for reporting purposes. What's the easiest way to do this?
As S. Lott said before me, CSV format is probably the best choice, but actually Excel is pretty clever about file formats. It will usually work with tab separated or space separated data, or even HTML tables. Try copy-and-pasting your data into Excel to see whether it can work it out, before worrying too much about the format.
Fix your Fortran output to be in CSV format. This is easily imported into a spreadsheet.
You can also write your data into a text file with the below code and then copy paste its contents to excel
before working with these data you must run "paste special wizard" to separate columns of the data in the excel
dimension a(100)
open (25,'output.txt')
do i=1,100
write(25,*) a(i)
end do