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,CH AIR 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,20061 113,1.00,
C9002,MR Test,37 Test AVE,Test Village2,,Test Town 2,,EF3 4GH,9876543210,20061101,CH AIR BED,YD3392,11,,N,20061113, 1.00,
-------------------------- ---------- ---------- ---------- ---------- --------
Is there a VB/VBA function I can use to reformat the data like this?
Thanks
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
XA0434,,90CM,N,20061113,1.
C9002,MR Test,37 Test AVE,Test Village2,,
Test Town 2,,EF3 4GH,9876543210,20061101,CH
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
C9002,MR Test,37 Test AVE,Test Village2,,Test Town 2,,EF3 4GH,9876543210,20061101,CH
--------------------------
Is there a VB/VBA function I can use to reformat the data like this?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER