#!/usr/bin/perl use Getopt::Long; %o = (); GetOptions (\%o, "type=s","rs=s","fs=s"); if(not defined $o{fs}) {$sep = '\s+';} else {$sep=$o{fs};} if(defined $o{rs}) {$/ = $o{rs};} if ($o{type} eq "mail"){ # mail format (Not Yet available mail2sexp(); } elsif ($o{type} eq "tab"){ #table format=STR-seq-seq sc2sexp(); } elsif ($o{type} eq "txt"){ #text format = STR-seq txt2sexp(); } else{ #text format = STR-seq txt2sexp(); } sub sc2sexp{ print"("; while(<>){ chop; print "("; for(split(/$sep/)){ print "\"$_\" " ;} print ")\n"; } print")"; } sub txt2sexp{ print"("; while(<>){s/[\\"]/\\$&/g; chop ; print"\"$_\"\n" ;} print")\n"; }