MartinS13X
New Member
- Joined
- Apr 4, 2018
- Messages
- 17
- Office Version
- 2019
- Platform
- Windows
I am trying to import a CSV file into excel via VBA and have it split the text into several columns based on "standard"-delimiters such as "," and also split it at certain words appearing in the text.
Below is an (edited) excerpt of the csv file:
(The current file is about 700 lines, but will become longer)
Obviously, splitting the text on the "," delimiter gives me the 5 columns but I'd like to split the description further. One would think splitting it on "-" would work, but of course there's always this exception that messes things up.
If I could split the description on the words "Date" and "Card" (and/or other keywords/delimiters) it would help me a lot. So it would (probably) look like this:
<tbody>
</tbody>
Thanks in advance...
Below is an (edited) excerpt of the csv file:
(The current file is about 700 lines, but will become longer)
06/01/2019,Supermarket - Visa Purchase - Receipt 148833 Date 05 Jan 2019 Card xxxx,,-301.07,180.13
06/01/2019,Random Store - Visa Purchase - Receipt 148832 Date 04 Jan 2019 Card xxxx,,-153.66,481.20
05/01/2019,Shell Petrol Station - Visa Purchase - Receipt 144494 Date 04 Jan 2019 Card xxxx,,-115.14,634.86
04/01/2019,Money Transfer - Deposit - Date 04 Jan 2019, ,750.00,,0
Obviously, splitting the text on the "," delimiter gives me the 5 columns but I'd like to split the description further. One would think splitting it on "-" would work, but of course there's always this exception that messes things up.
If I could split the description on the words "Date" and "Card" (and/or other keywords/delimiters) it would help me a lot. So it would (probably) look like this:
06/01/2019 | Supermarket - Visa Purchase - Receipt 14883 | 05 Jan 2019 | xxxx | -301.07 | 180.13 | |
06/01/2019 | Random store - Visa Purchase - Receipt 148832 | 04 Jan 2019 | xxxx | -153.66 | 481.20 | |
05/01/2019 | Shell Petrol Station - Visa Purchase - Receipt 144494 | 04 Jan 2019 | xxxx | -115.14 | 634.86 | |
04/01/2019 | Money Transfer - Deposit | 04 Jan 2019 | 750 | 0.00 |
<tbody>
</tbody>
Thanks in advance...