+ Reply to Thread
Results 1 to 6 of 6

Macro, to remove commas and remove speach marks

  1. #1
    Registered User
    Join Date
    12-13-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    42

    Macro, to remove commas and remove speach marks

    Hi Guys.

    I have a csv file which is converted to a .txt file. Please find the txt file attached. The other csv is having difficulty uploading. Ill try on a seperate post to try and upload this.

    I need to take the csv file and write some code to it so it writes to either:

    1. Another csv file or a txt file directly without any of the trailing commas at the end of each line. )Line 1,3,5,7 etc have 10 or so commas which dont need to be there. Also line 2, 4, 6 etc contains an amount with speach marks, The speach mark in line 2 number is "3,543.00".

    I was able to use some code which takes one file and writes to another which removes the comma's, this works, however i now need to edit the code so that it picks up the " speach marks " and removes them also :

    Please Login or Register  to view this content.
    Does anyone know how i can do this?

    Regards

    Shil
    Attached Files Attached Files
    Last edited by Cutter; 07-30-2012 at 01:24 PM. Reason: Added code tags

  2. #2
    Registered User
    Join Date
    12-13-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Macro, to remove commas and remove speach marks

    Heres the other file.

    Thanks

    Shil
    Attached Files Attached Files

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro, to remove commas and remove speach marks

    @ 5h1l

    You've been a member long enough to know about the requirement to use code tags. Here's a reminder:

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  4. #4
    Registered User
    Join Date
    12-13-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Macro, to remove commas and remove speach marks

    Apologies Cutter.

  5. #5
    Registered User
    Join Date
    12-13-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Macro, to remove commas and remove speach marks

    Does anyone have a solution for this? Ive looked everywhere and am unable to find anything.

  6. #6
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Macro, to remove commas and remove speach marks

    Can you show me how you want line 2 to look?
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  7. #7
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro, to remove commas and remove speach marks

    5h1l,

    If all you want is to remove commas and double-quotes, you can use the Replace method:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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