Link to home
Start Free TrialLog in
Avatar of sam_norian
sam_norian

asked on

Help with a multi-line CSV file

Hi,

One of our customers uses an old 16 bit piece of software that can only output 132 characters per line on the output file, the problem each "order" is between 290 to 350 characters long to an "order" has to be split over three lines in the output file, for example:

--------------------------------------------------------------------------

C9001,MRS Test ,33 Test CLOSE,,Test Village,
Test Town,,AB1 2CD,0123456789,20061101,SL/STORE DIVAN,
XA0434,,90CM,N,20061113,1.00,
C9002,MR Test,37 Test AVE,Test Village2,,
Test Town 2,,EF3 4GH,9876543210,20061101,CHAIR BED,
YD3392,11,,N,20061113,1.00,

--------------------------------------------------------------------------

Each order always starts with the order ref (the letter C followed by 4 numbers) i.e. "C9001" or "C9002". To import these order into my Access DB I need all the order data on one line eg:

--------------------------------------------------------------------------

C9001,MRS Test ,33 Test CLOSE,,Test Village,Test Town,,AB1 2CD,0123456789,20061101,SL/STORE DIVAN,XA0434,,90CM,N,20061113,1.00,
C9002,MR Test,37 Test AVE,Test Village2,,Test Town 2,,EF3 4GH,9876543210,20061101,CHAIR BED,YD3392,11,,N,20061113,1.00,

--------------------------------------------------------------------------

Is there a VB/VBA function I can use to reformat the data like this?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of KelvinY
KelvinY

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sam_norian
sam_norian

ASKER

Perfect!