+ Reply to Thread
Results 1 to 8 of 8

Open files in folder, replace comma with semicolon etc, save and close

  1. #1
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Open files in folder, replace comma with semicolon etc, save and close

    Thank you, problem solved
    Attached Files Attached Files
    Last edited by soreno; 10-29-2019 at 07:02 AM. Reason: missed a few points

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question

    Hi,

    Why Excel as

    • its easier to ask to the creator of csv file to export to your expected format.

    • Excel may import directly a csv file, did you at least try to just well answer to the Import Assistant ? …

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Open files in folder, replace comma with semicolon etc, save and close

    Testing with importing these csv files I did not manage to get any useful result from the '"testfile"

    imp_csv1.jpg

    testing you "20191028_testfil.csv" looked a bit better

    imp_csv2.jpg

    and importing using "TextFileSemicolonDelimiter = True" and ".TextFilePlatform = 28591" (i.e. 28591 Western European (ISO)) made the result looking ok.

    imp_csv3.jpg

    but as the last file is one that you have modified I'm not sure this is of any help to you as the setting 28591 Western European (ISO) made things a bit better for the "testfil.csv" but not all Swedish characters were "translated" properly. And there was other problems as well.

    Alf

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Open files in folder, replace comma with semicolon etc, save and close

    Give this a try:
    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  5. #5
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: Open files in folder, replace comma with semicolon etc, save and close

    Yes I did a few weeks ago, but have not seen any answers, its an plugin where you can choose different types of formats, csv is one of them...

  6. #6
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: Open files in folder, replace comma with semicolon etc, save and close

    @WideBoyDixon,
    Thanks I will give this a try tomorrow, looks promising
    @Marc L, yes I have done that, it is actually a plugin to a GIS software that can batch export layers to different file formats including csv files. I might look at the source file and see if I can get a better option by doing it in another way.
    @Alf, thanks for trying I have been doing all sorts of test to see what works best, I might just go back to source and try from there, its about +3 million rows

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Open files in folder, replace comma with semicolon etc, save and close

    If each CSV is that many rows, I'm not sure my solution will work; you'll run out of memory.

    WBD

  8. #8
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: Open files in folder, replace comma with semicolon etc, save and close

    @WideBoyDixon, the master is +3 million rows and split up to about 300 files. I did run your solution on all 300 and it took about 2 hours to finish the process. I have checked randomly some of the files and it looks fine

    Thanks a million, this works fine for me until I can get something that can deal directly with the master file, that will save a lots of time.
    My problem is solved

+ 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. Convert CSV files located on one folder and save as tab delimited by tab & Comma
    By albert28 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2018, 08:54 AM
  2. [SOLVED] macro to open all files in a folder, save them, then close them
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2013, 06:40 PM
  3. Open every file in the folder, remove merge and wrap, save and close files
    By abdesai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2013, 04:58 PM
  4. [SOLVED] Macro to open and close all files in a folder and sub folders
    By BillDoor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-31-2012, 06:51 AM
  5. open all txt files (delimited tab comma ) in a folder
    By curbster in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-12-2009, 07:11 PM
  6. Replies: 2
    Last Post: 11-30-2005, 01:55 AM
  7. I like to open a folder,auto print,save then close
    By tied of opening files in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2005, 06:06 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