Here is what I have: open ('input', 'C:/Organization.txt') or die "Cannot open file: $!"; open ('output', '>C:/out.txt') or die "Cannot open file: $!";
while (<input>) { my ($v1,$v2,$v3,$v4,$v5,$v6,$v7,$v8,$v9,$v10,$v11,$v12,$v13,$v14,$v15,$v16,$v17,$v18,$v19,$v20,$v21,$v22,$v23,$v24) = split (/,/); print output "$v1,$v2,$v3,$v4,$v5,$v6,$v7,$v8,$v9,$v10,$v11,$v12,$v13,$v14,$v15,$v16,$v17,$v18,$v19,$v20,$v21,$v22,$v23,$v24\n"; } This reads the input file one line at a time, seperates the variables using the comma as the delimiter, and outputs the variables to a file called out.txt. The challenge is that the file is a structured hierarchy as explained in the original post, I do not know when the lowest level (employee, and this an employees name) will occur in the hierarhcy and I need to get this lowest level value as the first variable in my out.txt file. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/