get a value from a table and save as a csv file<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />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
Re: get a value from a table and save as a csv filechange 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.
Re: get a value from a table and save as a csv fileC:\data exists.
A number.
Re: get a value from a table and save as a csv fileWhat 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.
Re: get a value from a table and save as a csv fileHi 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.
Re: get a value from a table and save as a csv fileHere 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));