I am trying to develop a scriptwhich takes 2 arguments and one option
Example
./1.pl <File1> <outputfile> -s ","
Here file1 is a text file withsome data (Say extracted from DB).
I do know know what this file contains or waht is the delimiter it has. But i am assuming the delimiter is coma or pipe(|) or single space or tab (4 spaces).
-s is the option indicating that "," is the delimiter of the file <File1>
-s can be "," or "|" or " " or "\t" for coma, pipe, space, tab respectively.
While reading File1 each line, I am using a split function passing the -s option.
My Problem here is
./1.pl <File1> <outputfile> -s "," ==> Works fine if File1 is coma separated
But what if File1 is pipe separated and i am specifying the -s option as coma.
Then too it works but i dont get teh expected result.
I hope the question is clear or am i confusing