Export to cvs combining fixed width and delimiter (1 Viewer)

zeeforel

Registered User.
Local time
Tomorrow, 00:01
Joined
Aug 11, 2004
Messages
25
Hi to you all!

I have a question about exporting a table to a csv file where I need the combination of:
  • a fixed (variable per field) width per field AND
  • a "; " (semicolon) as a delimiter
Using Access 2016 is this even possible?

Many thanks in advance!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:01
Joined
Oct 29, 2018
Messages
21,454
Hi. Not 100% sure but I am thinking maybe not. Otherwise, you might be able to create a query to insert the ";" in between each column, so you can then export the data using fixed width (size of 1 for the ;s). Just a thought...
 

jdraw

Super Moderator
Staff member
Local time
Today, 18:01
Joined
Jan 23, 2006
Messages
15,379
a fixed (variable per field) width per field
Example??

What exactly does this mean? Seems theDBguy understands, but I'm confused.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:01
Joined
Oct 29, 2018
Messages
21,454
Example??

What exactly does this mean? Seems theDBguy understands, but I'm confused.
I read it as creating an export spec to specify the width of each field.
 

zeeforel

Registered User.
Local time
Tomorrow, 00:01
Joined
Aug 11, 2004
Messages
25
Thanks for responding so quick! What I mean is this:
  • Field 1: width 6
  • Field 2: width 12
  • etc
and all fields separated by ";"

How can this be done? Many thanks!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:01
Joined
Oct 29, 2018
Messages
21,454
Thanks for responding so quick! What I mean is this:
  • Field 1: width 6
  • Field 2: width 12
  • etc
and all fields separated by ";"

How can this be done? Many thanks!
Hi. Did you see my reply? I just gave it a try, and it seems to do what you wanted.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:01
Joined
Oct 29, 2018
Messages
21,454
Yes, I did. But could you please give me a hint how to proceed? I do not have experience running VBA...

Thanks.
Has nothing to do with VBA. I just created a query based on a table. I added a ";" in between each column. Tried to export the query using fixed width, and it worked!
 

jdraw

Super Moderator
Staff member
Local time
Today, 18:01
Joined
Jan 23, 2006
Messages
15,379
Here is what I found via Google.
Fixed format means that the fields in your file have a fixed length. For instance first column is always 10 characters, second is 3 characters and third is 20 characters.
Delimited format means that there is a character used to separate every column on each line. The most common format are CSV (Comma-separated values) or TSV (Tab-separated values) files.
So depending of how your data is structured in your source file, you need to choose fixed or delimited.

I like theDBguy's approach with the query.
 

zeeforel

Registered User.
Local time
Tomorrow, 00:01
Joined
Aug 11, 2004
Messages
25
Has nothing to do with VBA. I just created a query based on a table. I added a ";" in between each column. Tried to export the query using fixed width, and it worked!

A ha, now I understand! Takes a bit of work but it is a great suggestion. Thanks very mucht for this!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:01
Joined
Oct 29, 2018
Messages
21,454
A ha, now I understand! Takes a bit of work but it is a great suggestion. Thanks very mucht for this!
Right. Otherwise, I am not sure there is a way to mix the two methods. Good luck!
 

Users who are viewing this thread

Top Bottom