我有一列包含以下数据
NStreetNames
1245 Thfs Ext. drive.
2454 saaa Ext. Drive.
我希望输出位于 3 个不同的列中,例如
One Two Three
1245 THfs Ext. Drive
2454 Saa Ext. drive
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
/*
Add your code here
*/
string Val = Row.NStreetNames.ToString();
Match match = Regex.Match(Val, @"^(?<One>\w+) (?<Two>\w+)(?: (?<Three>\w+))?$");
if (match.Success)
{
string o = match.Groups["One"].Value;
string t = match.Groups["Three"].Value;
string th = null;
if (match.Groups["Two"].Success)
{
th = match.Groups["Two"].Value;
}
Row.StreetNumber = o;
Row.Street = t;
Row.Address = th;
}
else
Row.StreetNumber = Row.NStreetNames.ToString();
}
此代码只是将我的所有数据重定向到三个