I have a table and I would like to grab a single value from a certain cell and then save the value as a csv file to use in excel
Here is a simple script that does what you indicated you want:
names default to here(1);
dt=open("$SAMPLE_DATA\Big Class.jmp");
single value = dt:name[5];
save text file("C:\Temp\Sample.csv",single value);
If the single value you are saving is a numeric value, then just use a format() function to convert it.
save text file("C:\Temp\Sample.csv",format(single value,"Fixed Dec",5,2));
Hi Jim,
Thanks for the help,
I keep getting the following error when I try save the value:
Name Unresolved: Save Text File{1} in function 'Save Text File', Save Text File("C:\data\value.csv", value)
This is the code:
dt = current data table();
value = dt:RDIStoWDIS[1];
show (value);
Save Text File("C:\data\value.csv",value);
I can see the value in the log by using the show() function but the save itself isnt working.
What is displayed in the log for the variable "Value" from your "show(value)"?
Does the folder "C:\data" exists?
Remember, the variable value needs to be a character string.
C:\data exists.
A number.
change your "Save Text File" function to:
save text file(("C:\data\value.csv",format(single value,"Fixed Dec",5,2));
The numeric value needs to be converted to a character string to be written out using save text file.