Excel Data to Gauss

Hello

I need help with saving my data properly in excel in order to load to correctly into Gauss. This is my first time doing it and I am having difficulty importing my data from excel. Secondly can anyone help with the steps used to import data into Gauss from excel. I am using Gauss 14. Thank You.

 

11 Answers



0



Have you seen this tutorial describing loading Excel data into GAUSS?

aptech

1,393


0



Yes  I have but I seem  to be missing something because I am getting errors in my returns



0



I have a panel dataset and I do not know how that fits into the first line posted below (my_var)

my_var = { 1.1, 2.2, 3.3, 4.4, 5.5 };
file_name = "mydata.xls";
cell_range = "A2:A6";
sheet_num = 1;

spreadSheetWrite(my_var, file_name, cell_range, sheet_num);


0



Where is your data now? Is it in a file, or in GAUSS? You would use `spreadSheetWrite`, to write data to an Excel file that was already loaded in GAUSS. If it is in a file, what kind of file is it in?

aptech

1,393


0



My data is in an excel file



0



If you want to load (or read) numeric data from an Excel file into GAUSS, you need to use the function spreadSheetReadM. For example, if you want to read some data which is located in the cell range from B2:D10 from the first sheet of a file named my_dataset.xls, then you would enter

file_name = "my_dataset.xls";
range = "B2:D10";
sheet = 1;

my_data = spreadSheetReadM(file_name, range, sheet);

After running the above code, the specified contents of the Excel file will be in the GAUSS variable named my_data.

aptech

1,393


0



Thanks so much for your time. I am impressed by your willingness to help me. This is all very new to me.

However, after doing what you posted up here, I have

error G0064 and G0008 as my output consecutively. I tried to find the meaning of these error terms but I am still not able to relate it my work.

Thanks



0



The error G0064 : Operand missing and G0008 : syntax error indicate that you entered some part of the commands incorrectly. Can you post EXACTLY the text that you entered into GAUSS?

aptech

1,393


0



Thank You.

This is what I posted

new;
file_name = "my_PhDEuniceDataset.xlsx";
range = "C2:N652";
sheet = 2;

my_PhDEuniceDataset = spreadSheetReadM(my_PhDEuniceDataset, C2:N652 , 2);
end;



0



I made a few adjustments and this is what i entered :

new;
file_name= "my_PhDEuniceDataset.xlsx";
cell_range="C2:N652";
sheet_num= 2;

myPhDdata=SpreadsheetReadM(file_name, cell_range, sheet_num);
end;

print myPhDdata;

 

However, the output editor just reproduced what I entered. There is no dataset.

Thanks

 



0



What are the results from this code snippet?

file_name = "my_PhDEuniceDataset.xlsx";
cell_range = "C2:N652";
sheet_num = 2;

xl_files = filesa("*.xls*");
print xl_files;

myPhDdata = SpreadsheetReadM(file_name, cell_range, sheet_num);

print myPhDdata;

aptech

1,393

Your Answer


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 30 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy