Subject Re: separator for CSV file to be imported into dBase
From Akshat Kapoor <>
Date Thu, 24 Sep 2020 13:30:41 +0530
Newsgroups dbase.getting-started

On 24.09.2020 02:59, Gaetano wrote:
> There was a typo in Akshat's code ";" = Chr(59), I added the double
> quotes in the same stuff operation. Try this (mind the wordwrap for the
> line starting with "stuff", it belongs to the previous line).
> I have attached your sample input and the output produced by the below
> code.
> set safety off
> fout = new file()
> in = new file()
> in_file = getfile("input.csv")
>    if not empty(in_file)
>      fout.create("output.csv")
>      do while not fin.eof()
>         chr_str = fin.readln()
>           do while at(chr(59),chr_str) >0
>              chr_str = stuff(chr_str,at(chr(59),chr_str),1,'","')
>          enddo
>      chr_str='"'+chr_str+'"'
>          fout.writeln(chr_str)
>          enddo
> fin.close()
> fout.close()
> endif
> I am not sure I understand your comment about 500 successive fields,
> surely no table has 500 fields... can you clarify? (je parle francais si
> ca peut faciliter les choses, meme si pour avoir des reponses des vrais
> experts, l'anglais est preferable)
> if this is too slow, perhaps you need to consider using a regular
> expression, that is blazing fast on large volumes.

Good Afternoon Gaetano, Jean,
I am yet to see Mervyn's Code but going by the time frame he was working
on it till late hours so must be good.

The code which Gaetano modified needs further correction.
The first starting " and the ending " are missing.