Made script compatible with different file separator
Made script compatible with different file separator