About EasyMorph Tutorials & Examples Web-help

Concatenate 2 columns, but only if the 2nd column is titled <empty>

Hi there,

Our dataset (Excel file) has sometimes (!) extra columns, which in that case No Title (empty 1st row) or an ‘Column x’ title (depending on the setting: columns don’t have headers) .
All other column do have titles.

If this is the case I want to concatenate the previous column and this ‘extra’ column, so that the extra column can be deleted (and the file always consists of the same columns with titles), but … only if these extra columns (that without a title) exist.

How do I tell that the file has an extra column (a column count could be difficult as there may be more than one extra columns depending on datasource) and how to concatenate the values.

e.g.
If exist column C (without title), than concatenate column B + C into column B and delete column C.
If exist column M (without title), than concatenate column L + M into column L and delete column M.
etc.

File.XLS (32 KB)

Hello,

See this example.

  1. Place these files into same folder.
  2. Use parameter to test and try

image

Classeur1.xlsx (9,6 Ko)
concatene.morph (5,3 Ko)

Warning: Our case 2 are not the same than my sample but I think your case is more simple.

Thank you! This works excellent.

To learn more about EasyMorph visit easymorph.com.