처음에 단일 데이터 테이블을 여는 스크립트를 실행 중입니다. 그런 다음 For 루프를 실행하여 CSV에서 후속 데이터 테이블을 열고 첫 번째 데이터 테이블에 연결합니다. 스크립트 실행을보고있는 동안 제대로 작동하고 모든 행을 첫 번째 데이터 테이블에 추가하지만 스크립트가 끝날 때 많은 열을 삭제하고 519 행으로 끝납니다. 이 이후의 행이 삭제되는 이유를 알 수 없습니다. 어떤 도움이라도 환상적입니다! 아래 코드를 참조하십시오 :
//Initiates data table to hold all the data
data = New Table( "3DMark_All Loops" );
//Choose folder containing all .zip files
directory = Pick Directory();
subDir = directory || "All Loops/";
Create Directory(subDir); //create a new sub directory
TheFileList = Files In Directory(directory); //zip files
nFiles = N Items(TheFileList); //get number of zip files in directory
For( i = 1, i < 21, i++,
//open the zip folder and create a list of the files inside
za = Open( directory || zipFolder, zip );
dirlist = za << dir;
Show( dirlist ); // see all contents of zipped folder;
//choose the file from the file list called "Monitoring.csv" and save it in the subdirectory "All Loops" as the Loop Number
For(j = 1, j <= N Items( dirlist ), j++,
file = dirlist[j];
If( Left(file, 3) == "Mon",
text = za << read( file );
current = Save Text File( char(subDir) || char(i) || ".csv", text );
);
);
//Open the .csv file that was just created in the subdirectory
dt_temp = Open(current);
//Select Column 1 and Convert Text to Columns using a ; delimiter
Column(dt_temp, 1) << Set Selected;
dt_temp << Text To Columns(
delimiter( ";" ),
columns(1)
);
//Delete column 1 (which is empty)
dt_temp << Delete Columns(1);
//Create a new column called Loop Number
New Column( "Loop Number", Numeric, Continuous );
//Fill in the loop number for all cells of this column
colLengthTemp = N Rows(dt_temp);
LoopNumber = {};
For (s = 1, s <= colLengthTemp, s++,
LoopNumber[s] = i;
);
:"Loop Number" << Set Values(LoopNumber);
//Concatenate this loops data to the master data table
data << Concatenate( dt_temp, Append to first table );
//Close this temporary data table without saving
Close( dt_temp, nosave );
Wait(.001);
);