+ Reply to Thread
Results 1 to 12 of 12

clean up downloaded .csv file for import into program (final one)

  1. #1
    Registered User
    Join Date
    06-20-2014
    Location
    Houston, TX
    MS-Off Ver
    Office 365
    Posts
    47

    clean up downloaded .csv file for import into program (final one)

    hello all,

    I have a .csv file that I'm opening in excel in order to clean up a few things before I can successfully import it into another program. I've attached a spreadsheet to help explain what I'm trying to do. the first sheet named "before" is what I start with. the second sheet named "after" is what I'm looking for. I'm using the yellow highlighted rows to explain what I'm looking for.

    (a) there are certain things I can do by simply modifying code that a few of you have provided over the past week. examples follow :
    (i) I don't need help replacing the words in the "transaction type" column with actual 3 letter transaction symbols.
    (ii) I don't need help deleting columns D (amount) and E (source).
    (iii) I don't need help deleting the column header row.

    (b) what I do need help with is getting what I'll call "sub transactions" converted to "primary" transactions. an example. look at rows 10 through row 17 on the before sheet. the financial site that I downloaded this from chose to make my life difficult by using a "total" transaction on row 10, then providing all the details on rows 11 through 17. the entire spreadsheet is the same. so, I need the date and transaction type for the "primary transaction" to be copied to it's associated sub transactions. the result is what you see on the "after" tab in rows
    (c) next, the "primary" rows are then deleted. in the example provided, this means row 10 on the "before" sheet is deleted.
    (d) the final thing I need is a symbol column. so based on the name of each fund, column b (which is an inserted column) is populated with the fund symbols. these symbols are included on the tab named "list".
    (e) when done, the "before" sheet looks like the "after" sheet and is ready for me to import into my financial program.

    hope this makes sense.

    I realize I've had a few requests for help in the past week; and I certainly don't mean to abuse the privilege. this will be the last post you'll see from me in awhile, I'd imagine.

    thank you for all the help you guys have provided over the past week. it's been a real help to me.

    best regards,

    david

    excelforum5.xlsx

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,611

    Re: clean up downloaded .csv file for import into program (final one)

    You can adapt this for filling in the gaps:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-20-2014
    Location
    Houston, TX
    MS-Off Ver
    Office 365
    Posts
    47

    Re: clean up downloaded .csv file for import into program (final one)

    Tms,

    thank you for taking the time to post. I only know how to modify the code I provided in my original post. I tried running the code to see what it does; but it doesn't seem to take into account the fact that some transaction have multiple subtransactions, and some transactions have only one.

    would you or anyone else like to take another stab?

    thank you.

  4. #4
    Registered User
    Join Date
    06-20-2014
    Location
    Houston, TX
    MS-Off Ver
    Office 365
    Posts
    47

    Re: clean up downloaded .csv file for import into program (final one)

    can someone please take a stab at this?? I'd really appreciate it.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,611

    Re: clean up downloaded .csv file for import into program (final one)

    I think this does most of what you want. Test it on a copy of your data.

    Please Login or Register  to view this content.

    Regards, TMS

  6. #6
    Registered User
    Join Date
    06-20-2014
    Location
    Houston, TX
    MS-Off Ver
    Office 365
    Posts
    47

    Re: clean up downloaded .csv file for import into program (final one)

    TMS,

    thank you very much for taking another stab at it. I very much appreciate it. the code seems to get rid of the duplicates; but it is deleting my "date" column and my "transaction type" column and inserting zero's into these columns. it also doesn't look like it handles the symbols functionality mentioned in (d) of my original post.

    if you get a chance, can you take a look?

    best regards,

    David

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,611

    Re: clean up downloaded .csv file for import into program (final one)

    That's odd. It worked with the sample file you uploaded. And it doesn't delete any columns.

  8. #8
    Registered User
    Join Date
    06-20-2014
    Location
    Houston, TX
    MS-Off Ver
    Office 365
    Posts
    47

    Re: clean up downloaded .csv file for import into program (final one)

    TMS,

    ok. my mistake. I've been trying to code on my own without completely abusing the kindness of folks on this forum. as such, I had started making some intermediary steps and used your macro on a file that was slightly modified from that which I originally uploaded to this forum. thank you for calling me out on this. I ran it on the file I uploaded and it worked.

    would you like to take a stab at (d) in original post to completely close out?

    if not, would anyone else like to take a stab? run TMS macro on my file that I uploaded, then see (d) on original post above.

    thank you

    david

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,611

    Re: clean up downloaded .csv file for import into program (final one)

    (d) is/was done. It uses the list to apply the codes. However, I thought you wanted the description overwritten with the code ... my bad. Need to look at that.

    But I don't know where column C comes from, DRI, FES, etc.

    I'll have a look and come back later.


    Regards, TMS

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,611

    Re: clean up downloaded .csv file for import into program (final one)

    OK, this does everything you have asked for, I think.

    Please Login or Register  to view this content.

    Regards, TMS

  11. #11
    Registered User
    Join Date
    06-20-2014
    Location
    Houston, TX
    MS-Off Ver
    Office 365
    Posts
    47

    Re: clean up downloaded .csv file for import into program (final one)

    TMS,

    a very hearty, albeit somewhat belated (life happened again :>), thank you. this does it.

    much appreciated. blue star for you sir!!

    and rep too ;>)

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,611

    Re: clean up downloaded .csv file for import into program (final one)

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] clean up downloaded .csv file for import into program
    By wingfield65 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2014, 09:53 PM
  2. Replies: 0
    Last Post: 08-13-2013, 06:10 PM
  3. Is it possible to clean up and import such a raw text file as this to excel?
    By davidsky1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2012, 10:54 PM
  4. Text File import program not functioning
    By Oliver H in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2010, 04:13 PM
  5. Final Program Tuneup and suggestions
    By wilro85 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2007, 06:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1