안녕,
다음 "TestData"가 있습니다.

1. 상태가 다운되었을 때 셀 값이 null이 되기를 원합니다. 예를 들어("A status" 셀 값은 "down"입니다. 열 "A"의 값은 "1334" 대신 null이어야 합니다. B, C 및 D 열에 대해 동일한 작업을 수행해야 합니다.
2. 열 이름에 "상태"가 있는 모든 열을 삭제합니다.
출력은 다음과 같아야 합니다.


3. 이제 동일한 타임스탬프 행이 모두 병합되어야 합니다. 예상 출력은 다음과 같습니다. 그러나 JSL에서 더 나은 방법이 있습니까?)

여러 csv 파일에 대해 이 작업을 수행해야 합니다. 누군가 이것을 위해 JSL을 작성하는 데 도움을 줄 수 있습니까?
미리 감사드립니다.
이것은 당신을 위해 그것을해야하지만 스크립트는 상태 열이 바로 앞의 열에 해당한다고 가정합니다.상태 열의 이름을 보고 동일한 이름에서 " 상태"를 뺀 열을 찾아 이를 수행할 수 있지만 가정이 사실이라면 불필요하게 복잡하다고 생각했습니다.
dt = Current Data Table();
col_names = dt << Get Column Names(string);
//Assuming the corresponding value column for each status column is always the preceding one
//Loop backwards through the columns
for(i = N Col(dt), i>= 1, i--,
//If column name has word "status" in it
if(Contains(Lowercase(col_names[i]), "status") > 0,
//Look for instances of "{down}"
down_rows = dt << Get Rows Where( dt:(As Name(col_names[i])) == "{down}" );
//Assuming preceding column is the value column, replace {down} rows with missing
Column(dt, i-1)[down_rows] = .;
dt << Delete Columns(i);
);
);
//Create table summary to consolidate time stamp rows with same value
//Build a string that we can parse for the summary operation
remaining_cols = dt << Get Column Names("string");
summary_str = "dt_clean = dt << Summary( Group( :TimeStamp ), ";
//Loop through all columns except TimeStamp to add "Sum( <CURRENT col=""> )" to summary string
for(i = 2, i <= N Col(dt), i++,
summary_str = summary_str||"Sum( :Name(\!""||remaining_cols[i]||"\!")), ";
);
//Attach last part of script
summary_str = summary_str||"Freq( \!"None\!"),
Weight(\!"None\!"),
statistics column name format( \!"column\!" ),
Link to original data table( 0 ),
output table name( \!"CleanedData\!" ));";
//Parse and evaluate the string to create the summary table dt_new
eval(parse(summary_str));
//Delete N Rows column
dt_clean << Delete Columns(:N Rows);</CURRENT>