Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi forum,
im very confused when i tried to make sequence number from some file. For example i have 2 files with same attribute but different name. i called first file "file xxx" and the second is "file zzz".
in file xxx i have attribut :
code|name
101|kaya
102|jennifer
103|shakira
and then in file zzz i have attribut :
code|name
101|kaya
102|jennifer
104|raisa
i want to make output :
in file xxx
id|code|name
1|101|kaya
2|102|jennifer
3|103|shakira
in file zzz
id|code|name
1|101|kaya
2|102|jennifer
4|104|raisa
i tried using tAggregateRow and using sequence number ("s1,1,1") to group by code but in different file, sequence number always add.
my wrong output :
in file xxx
id|code|name
1|101|kaya
2|102|jennifer
3|103|shakira
in file zzz
id|code|name
4|101|kaya
5|102|jennifer
6|104|raisa
package routines;
import java.util.HashMap;
import java.util.Map;
public class Sequences {
public static Map<Integer,Integer> map = new HashMap<Integer, Integer>();
public static Integer value = 0;
public static Integer getId(Integer code) {
if (! map.containsKey(code)){
value = value +1;
map.put(code, value);
}
return map.get(code);
}
}
rhall_2.0 wrote:
Yeah, that would do it tdz (.......damn it, you got there first!)