嗨,我正在尝试将文件保存在 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" );
);
您可能需要执行“另存为”才能使其正常工作。