嗨,我正在嘗試將文件保存在 for 循環中,問題是如何將變量放入文件保存過程中,
但是,看起來文件保存部分不起作用。
我沒有使用任何明確的全局來確保已為文件名分配了原始值。
我的儲蓄部分有問題嗎?
謝謝
// filename is a variable assigned below,
For( j = 1, j <= N Row( sdt ), j++,
filename = Column( sdt, "file" )[j];
Close( Data Table( sdt ), No Save );
// During saving the file, the directory is fixed, however the filename is an variable, <BR />// the goal is to use the left(filename,18) and concatenate with "_Type1" in the file name.
dt1 = Current Data Table();
dt1 << save( "C:\Users\file\JSL\"||Right( filename,18)||"_Type1.csv" );
你好
我改變了代碼,所以這可能會有所幫助:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
path = "C:\Users\file\JSL\"
For( j = 1, j <= N Row( dt ), j++,
dt << save as (path || dt:name[j] || "_Type1.csv" );
);
您可能需要執行“另存為”才能使其正常工作。