open ( txtFileIn, $ARGV[0] ) || die ("Could NOT open " . $ARGV[0] . ".\n"); @txtFileIn = ; print scalar @txtFileIn ; foreach $row (@txtFileIn) { chomp($row); print "\n" . index ($row , '|'); ($size, $item) = split /|/, $row; print "\n**",$row, $size, $item ; chomp($size); chomp($item); $cnt = $item =~ s/(\\)/$1/gi; $item .= ('|' x $cnt ) . $item ; # print "\n" , $size . $item, $cnt; } #foreach row close txtFileIn;