+ Reply to Thread
Results 1 to 10 of 10

Saving Comma Separated .txt files as .csv files

  1. #1
    Registered User
    Join Date
    04-18-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    40

    Saving Comma Separated .txt files as .csv files

    Hello Everyone,

    I have a large number of .txt files that are comma separated files (but not saved with the .csv extension) that I need to convert to files with the .csv extension.

    Is there an easy way to do this for all files in a given folder? Ideally, the files don't even need to be opened as they are are quite large in size (70MB+) and there are a lot of them (500+).

    Any code snippets would be greatfully received.

    Many thanks for your time,
    twills

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Saving Comma Separated .txt files as .csv files

    why do you need to change them?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    04-18-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Saving Comma Separated .txt files as .csv files

    pike,

    Unfortunately a third party application that reads .csv files but not .txt files

    Kindest Regards,
    twills

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Saving Comma Separated .txt files as .csv files

    Hmm.
    I though they were the same thing
    try ...
    rihgt click on a csv file
    then select open with
    pick note pad
    apply to all


    or just change the extensions from csv to txt

  5. #5
    Registered User
    Join Date
    09-05-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Saving Comma Separated .txt files as .csv files

    i cant say which application you are using to choose files

    but most of the applications usees default extension in browse / open window
    under files of Types to populate files under that ext ..

    While selecting your CSV, just press *.txt and enter, which will populate all txt files under that folder..., rest your application should take that file as format seams same ......

    but again that depends on which application you have used...


    Vora

  6. #6
    Registered User
    Join Date
    04-18-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Saving Comma Separated .txt files as .csv files

    Pike & Vorabha,

    Many thanks for your suggestions.

    The third party application I'm using simply looks in a folder for files with a .csv extension. If there aren't any there (such as in this case), it simply reports that no .csv files could be found, hence the necessity to perform the conversion from .txt to .csv before the third party app takes over.

    Changing the extension manually would work, but there are over 500 of the blighters, so it may take me a while

    Would it be possible to get vba to cycle through each of the files in a folder (without opening them) and simply do a saveas with the extension as the required .csv?

    Kindest Regards,
    twills

  7. #7
    Valued Forum Contributor
    Join Date
    08-26-2006
    Location
    -
    MS-Off Ver
    2010
    Posts
    388

    Re: Saving Comma Separated .txt files as .csv files

    Get to the Command Prompt, change directory and use the DOS REN command, REN *.txt *.csv

  8. #8
    Registered User
    Join Date
    09-05-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Saving Comma Separated .txt files as .csv files

    hv you tried my way, by typing *.txt ??, it worked for me..

    well other way is take list of files in commandprompt by
    Please Login or Register  to view this content.
    this will list our file name, in xls open and sep them with text to columns, take ext also out of file names.

    run a simple rename command in way excel returns value as
    Please Login or Register  to view this content.
    save this results in new notepad, save as .bat and run ..


    Vora

  9. #9
    Registered User
    Join Date
    04-18-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    40

    [Solved] Saving Comma Separated .txt files as .csv files

    T-J and vorabha,

    Many thanks for your help - the command prompt line worked wonderfully!

    Kindest Regards,
    Twills
    Last edited by twills; 09-15-2009 at 12:11 PM. Reason: [Solved]

  10. #10
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Saving Comma Separated .txt files as .csv files

    twills
    can you please mark your post solved

+ 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