Change Delimiter to CSV

October 12, 2011 at 06:14:38
Specs: Windows Vista
I need to change the delimiter character in all csv files in a folder.
I want to change it from TAB to ;
Can someone help me please?
Thank you!

See More: Change Delimiter to CSV

Report •


#1
October 12, 2011 at 14:02:42
A semicolon is not a comma. Will the program opening the file accept the change?

Report •

#2
October 12, 2011 at 23:36:35
I believe it will.
Can you please help me?

Report •

#3
October 13, 2011 at 02:39:42
Copy a few files and use a text editor to change the tabs to semicolons using a global search and replace. Then run your program and check if there are any errors. How many files do you have to convert?

Report •

Related Solutions

#4
October 13, 2011 at 04:08:28
360 files! That's why i want a batch to do so!

Report •

#5
October 13, 2011 at 05:14:56
If you create the CSV file from for example MS Excel, while having the country settings set to a country that uses comma as decimal separator, the "CSV" file will automatically use semicolon as field separator.

Nigel

Mobo: Asus P7P55D LE
OS: Microsoft Windows 7 Professional OEM
CPU: Core i5 750 @ 2.67 GHz
RAM: Corsair Dominator DHX+ DDR3 1600MH 4GB
GPU: Sapphire 4870 D


Report •

#6
October 13, 2011 at 06:41:18
360 is a moderate amount. The biggest file conversion I had done was 23,000. I wrote a BASIC program to do it. There is a text editor (Note Tab Light) that has a semi-auto macro-like mode that could do the search and replace in groups of files.

Report •

#7
October 13, 2011 at 13:44:09
I suggest VBScript:
Const dirPath = "C:\Some\Directory"
Set fso = CreateObject("Scripting.FileSystemObject")
For Each file In fso.GetFolder(dirPath).Files
  If LCase(fso.GetExtensionName(file)) = "csv" Then
    fileText = Replace(fso.OpenTextFile(file).ReadAll, vbTab, ";")
    fso.OpenTextFile(file, 2, True).Write fileText
  End If
Next 'file

How To Ask Questions The Smart Way


Report •

Ask Question