在 CSV 模式下指定的单元格中设置文本。
document.SetCell( yLine, iColumn, str, flags );
document.SetCell( yLine, iColumn, str, flags )
yLine
指定要设置的文本的行号。
iColumn
指定要设置的文本的列索引。
str
指定要设置的字符串。
flags
指定下列值之一。
eeAutoQuote |
查看字符串是否包含分隔符,换行符,或引号,跳过这些字符,必要时添加引号。 |
eeDontQuote |
不做上述过程。 |
eeAlwaysQuote |
总是添加引号。 |
下面的示例会在第三列的左边插入一个空列,并合并第一列和第二列的内容作为插入的这个列的内容。在运行这个宏之前,CSV文档必须处于活动状态。
document.InsertColumn( 3 );
nLines = document.GetLines() - 1;
for( y = 1; y <= nLines; y++ ) {
s1 = document.GetCell( y, 1, eeCellIncludeNone );
s2 = document.GetCell( y, 2, eeCellIncludeNone );
s3 = s1 + " " + s2;
document.SetCell( y, 3, s3, eeAutoQuote );
}
document.InsertColumn 3
nLines = document.GetLines() - 1
For y = 1 To nLines
s1 = document.GetCell( y, 1, eeCellIncludeNone )
s2 = document.GetCell( y, 2, eeCellIncludeNone )
s3 = s1 + " " + s2
document.SetCell y, 3, s3, eeAutoQuote
Next
支持 EmEditor Professional 16.7 或之后的版本。