Guys,
I hope that someone has a full code, it is necessary for me for urgent work
till this night, or the request is to give me a links to a similar question
I will try to explain an existing situation
Say, i have the delimited text file of such contents:
(comma delimited ending with comma)
"ST1,1022.519,927.347,100.522,"
"KON1,1022.519,927.347,100.522,"
"2,1022.519,927.347,100.522,"
It can be of such contents
(comma delimited without ending char)
"ST1,1022.519,927.347,100.522"
"KON1,1022.519,927.347,100.522"
"2,1022.519,927.347,100.522"
Or even the such
(semicolon delimited ending with comma)
"2;1022.519;927.347;100.522,"
"ST1;1022.519;927.347;100.522,"
"KON1;1022.519;927.347;100.522,"
Or still the such
(semicolon delimited ending with semicolon)
"2;1022.519;927.347;100.522;"
"ST1;1022.519;927.347;100.522;"
"KON1;1022.519;927.347;100.522;"
ETC... ETC..
Even line may starts from number or alpha-numeric part
The question is how to retrive a separator and to remove
ending separator in every line ( if this exists )
at runtime, in one shot only
What I have stuck on yet
(defun check_del (str_line /)
(cond
((eq 44 (last (vl-string->list str_line ))) ",")
((eq 58 (last (vl-string->list str_line ))) ":")
((eq 59 (last (vl-string->list str_line ))) ";")
((eq 9 (last (vl-string->list str_line ))) "\t")
((eq 0 (last (vl-string->list str_line )))
(substr (vl-string-trim "0123456789" str_line) 1 1));it's working good, if the first item is numeric only
(T (alert "Impossible to read your text\nAsk your dork programmer about.")(exit)))
)
Hmm, I have just 4 hours to finish this work