Hi,
I have a text value in a variable that contains a name. The name is in the format First, Middle, Last, however, Middle is optional.
I have used a split function to break the names in their individual components are output into columns.
If the name contains First, Middle, Last, I output the values into separate columns using Split.
However, if the name only contains First and Last, I want the Last to be recorded in the last column instead of the middle column.
For example[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]First[/TD]
[TD]Middle[/TD]
[TD]Last[/TD]
[/TR]
[TR]
[TD]John Mark Smith[/TD]
[TD]John[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[/TR]
[TR]
[TD]Hugo Harris[/TD]
[TD]Hugo[/TD]
[TD]Harris[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I want
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]First[/TD]
[TD]Middle[/TD]
[TD]Last[/TD]
[/TR]
[TR]
[TD]John Mark Smith[/TD]
[TD]John[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[/TR]
[TR]
[TD]Hugo Harris[/TD]
[TD]Hugo[/TD]
[TD][/TD]
[TD]Harris[/TD]
[/TR]
</tbody>[/TABLE]
Any suggestions appreciated.
I have a text value in a variable that contains a name. The name is in the format First, Middle, Last, however, Middle is optional.
I have used a split function to break the names in their individual components are output into columns.
If the name contains First, Middle, Last, I output the values into separate columns using Split.
However, if the name only contains First and Last, I want the Last to be recorded in the last column instead of the middle column.
For example[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]First[/TD]
[TD]Middle[/TD]
[TD]Last[/TD]
[/TR]
[TR]
[TD]John Mark Smith[/TD]
[TD]John[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[/TR]
[TR]
[TD]Hugo Harris[/TD]
[TD]Hugo[/TD]
[TD]Harris[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I want
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]First[/TD]
[TD]Middle[/TD]
[TD]Last[/TD]
[/TR]
[TR]
[TD]John Mark Smith[/TD]
[TD]John[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[/TR]
[TR]
[TD]Hugo Harris[/TD]
[TD]Hugo[/TD]
[TD][/TD]
[TD]Harris[/TD]
[/TR]
</tbody>[/TABLE]
Any suggestions appreciated.