C
clearguy02
Hi folks,
I am playing around on the below issue. I have a file, C:\test.txt
with the following content:
--------------------------------------------------------------------------------------------------------------
user id name email employee
uid manager uid
jcarter john (e-mail address removed) 00206251
00207609
mstella mary (e-mail address removed) 00207609 00220458
msmith martin (e-mail address removed) 00202227 00207609
bborders bob (e-mail address removed) 00220458 00202003
swatson sush (e-mail address removed) 00224981 00207609
rcasey rick (e-mail address removed)
00202003 00201009
----------------------------------------------------------------------------------------------------------------
mstella is the boss of jcarter, msmith and swatson;
bborders is the boss of mstella;
rcasey is the boss of bborders;
Now I need to replace the manager uid's with the boss id's; for the
top-most manager's id, you can replace his manager uid with his user
id itself (in this case rcasey is the top-most guy).
i.e the output file should be as follows:
---------------------------------------------------------------------------------
user id name email manager id
jcarter john (e-mail address removed) mstella
mstella mary (e-mail address removed) bborders
msmith martin (e-mail address removed) mstella
bborders bob (e-mail address removed) rcasey
swatson sush (e-mail address removed) mstella
rcasey rick (e-mail address removed) rcasey
--------------------------------------------------------------------------------
I am struggling to figure it out with hashes and arrays, but not
getting a desired result.. can some one help me out here?
Thanks,
JC
I am playing around on the below issue. I have a file, C:\test.txt
with the following content:
--------------------------------------------------------------------------------------------------------------
user id name email employee
uid manager uid
jcarter john (e-mail address removed) 00206251
00207609
mstella mary (e-mail address removed) 00207609 00220458
msmith martin (e-mail address removed) 00202227 00207609
bborders bob (e-mail address removed) 00220458 00202003
swatson sush (e-mail address removed) 00224981 00207609
rcasey rick (e-mail address removed)
00202003 00201009
----------------------------------------------------------------------------------------------------------------
mstella is the boss of jcarter, msmith and swatson;
bborders is the boss of mstella;
rcasey is the boss of bborders;
Now I need to replace the manager uid's with the boss id's; for the
top-most manager's id, you can replace his manager uid with his user
id itself (in this case rcasey is the top-most guy).
i.e the output file should be as follows:
---------------------------------------------------------------------------------
user id name email manager id
jcarter john (e-mail address removed) mstella
mstella mary (e-mail address removed) bborders
msmith martin (e-mail address removed) mstella
bborders bob (e-mail address removed) rcasey
swatson sush (e-mail address removed) mstella
rcasey rick (e-mail address removed) rcasey
--------------------------------------------------------------------------------
I am struggling to figure it out with hashes and arrays, but not
getting a desired result.. can some one help me out here?
Thanks,
JC