Hi mbocian
I amnot sure there is a macro that could do what you want however there is a way you can do it using the basic search and replace commands in MS Word. If you follow the instructions below word for word it will do 98% of what you want and you will then need to do a little tidying up in Excel at the end of the process. Follow the steps in exactly the order shown:
1. Save the file as a text file (csv).
2. Open the text file with MS Word (any version will do).
3. Enter Ctrl+H (this will invoke the search and replace dialogue box).
Note: When entering in the search and replace boxes enter exactly what is between the single quote marks in each case only - take care to also enter a space where shown.
4. In the search box enter '^p^p' and in the replace with box enter '^p'. Then enter Alt+H and then click on the OK buton.
5. In the search box enter '^p"' and in the replace with box enter '^p'. Then enter Alt+H and then click on the OK buton.
6. In the search box enter '",,' and in the replace box enter ',,'. Then enter Alt+H and then click on the OK buton.
7. In the search box enter '"^t' and in the replace box enter '^t'. Then enter Alt+H and then click on the OK buton.
8. In the search box enter '",' and the the replace box enter '^t. Then enter Alt+H and then click on the OK buton.
9. In the search box enter '^t"' and in the replace box enter '^t'. Then enter Alt+H and then click on the OK buton.
10. In the serch box enter '"^p' and in the replace box enter '^p'. Then enter Alt+H and then click on the OK buton.
11. In the search box enter ', ' (remember the space here) and in the replace box enter '^t'. Then enter Alt+H and then click on the OK buton.
12. Save the file (do not change the format when you save it).
13. Open Excel and import the text file making sure you use "Tab" as the delimiter.
You will have some minor tidying up to do but this process will get you approximately 98% what you want.
Hope this helps.
TKHussar
|