Topic: Flat-file to CSV conversion (1 of 5), Read 78 times
Conf: Converting, Translating
From: Ted Green
Date: Tuesday, July 06, 2004 05:24 PM

We plan to write a macro to convert flat-files to CSV format with a selectable delimiter. In other words, convert a file like:

Ted Green 100 Main Street Ann Arbor MI
Thomas Burt 200 Division Street Ann Arbor MI

to something like:

"Ted","Green","100 Main Street","Ann Arbor","MI"
"Thomas","Burt","200 Division Street","Ann Arbor","MI"

If someone already has such a macro, please post it here.

Ted.

 


Topic: Flat-file to CSV conversion (2 of 5), Read 83 times
Conf: Converting, Translating
From: Ian Binnie
Date: Wednesday, July 07, 2004 07:05 AM

On 7/6/2004 5:24:57 PM, Ted Green wrote:
>We plan to write a macro to
>convert flat-files to CSV
>format with a selectable
>delimiter. In other words,
>convert a file like:
>
>Ted Green
>100 Main Street Ann
>Arbor MI
>Thomas Burt
>200 Division Street Ann
>Arbor MI
>
>to something like:
>
>"Ted","Green","100 Main
>Street","Ann Arbor","MI"
>"Thomas","Burt","200 Division
>Street","Ann Arbor","MI"
>
>If someone already has such a
>macro, please post it here.
>
>Ted.
>
Ted,

some time ago I posted a macro to extract details from signatures such as used in email messages.

This may be of some use.

I am currently away from home in a motel room. I will check further when I return home.

 


Topic: Flat-file to CSV conversion (4 of 5), Read 87 times, 1 File Attachment
Conf: Converting, Translating
From: Ian Binnie
Date: Friday, July 09, 2004 02:04 AM

On 7/7/2004 7:05:48 AM, Ian Binnie wrote:
>On 7/6/2004 5:24:57 PM, Ted Green wrote:
>>We plan to write a macro to
>>convert flat-files to CSV
>>format with a selectable
>>delimiter.
>>
>>If someone already has such a
>>macro, please post it here.
>>
>>Ted.
>>
>Ted,
>
>some time ago I posted a macro to
>extract details from signatures such as
>used in email messages.
>
This is primarily designed to utilise hints e.g. "Phone:" to detect fields, but includes a routine to guess names. This last may help.

I am not sure now whether you were looking at a flat file with a known format, or a general macro.

 
ACARD(1).VDM (13KB)

 


Topic: Re: Flat-file to CSV conversion (5 of 5), Read 97 times
Conf: Converting, Translating
From: Ted Green
Date: Friday, July 09, 2004 08:51 AM

At 02:05 AM 7/9/2004, you wrote:
>>some time ago I posted a macro to
>>extract details from signatures such as
>>used in email messages.

Thank you. Tom has nearly finished a comprehensive Flat-file conversion macro.

Ted.

 


Topic: Flat-file to CSV conversion (3 of 5), Read 81 times, 1 File Attachment
Conf: Converting, Translating
From: Christian Ziemski
Date: Wednesday, July 07, 2004 08:00 AM

On 7/6/2004 5:24:57 PM, Ted Green wrote:
>We plan to write a macro to convert flat-files to CSV
>format with a selectable delimiter.
>[...]
>If someone already has such a macro, please post it here.

I didn't have, but now I have.
A 10-minute-quickshot.

It does what you showed in your example.

Since it's not easy to know what parts of the source have to be combined to one entry in the target I used the following approach:

Reg_Set(103, "1 1 3 2 1") // template to describe the source
//Reg_Set(103, "*") // or: every word will become a single entry

Reg_Set(104, ",") // the delimiter for the target

This way I'm defining the number of whitespace-delimited "words" per entry in a line.
If there are more "words" in a line than defined, the reminder is combined into one entry.

Just an idea.

Christian

 
FLAT2CSV.VDM (2KB)