Show for parents and indent children

Hi,

I’d like to output a flat file with data that looks a little like this:


COUNTRY  TYPE  MAKE
Japan    Car   Toyota
               Mazda
         Bike  Honda
               Yamaha
Germany  Car   Mercedes Benz
               Audi
               Volkswagen

Is there a straighforward/natural way of doing this?

The input looks like this:


COUNTRY  TYPE  MAKE
Japan    Car   Toyota
Japan    Car   Mazda
Japan    Bike  Honda
Japan    Bike  Yamaha
Germany  Car   Mercedes Benz
Germany  Car   Audi
Germany  Car   Volkswagen

Hi, mwgjordan,

I would use just Reformat with CTL code like the following:

string country = "";
string type = "";
string make = "";

function integer transform() {
	if (!isnull($in.0.COUNTRY)) {
		country = $in.0.COUNTRY;
	}
	if (!isnull($in.0.TYPE)) {
		type = $in.0.TYPE;
	}
	if (!isnull($in.0.MAKE)) {
		make = $in.0.MAKE;
	}
	
	$out.0.COUNTRY = country;
	$out.0.TYPE = type;
	$out.0.MAKE = make;

	return ALL;
}

Best regards,