Convert comma seperated (csv) file to semicom

February 8, 2011 at 23:00:33
Specs: Windows XP
I want a batch program to convert comma seperated (csv) file to semicolon seperated (csv) file

See More: Convert comma seperated (csv) file to semicom

Report •

#1
February 9, 2011 at 02:07:05
i guess the simple thing would be open the file in notepad and replace , with ;

Will it work for you

Subhash Chandra.
www.s-chandra.co.cc


Report •

#2
February 9, 2011 at 02:32:47
No.. I have to do it all automatically..
I cant open it in notepad and do replace..

We have an Indian application (1) which automatically generates a comma seperated csv file and stores in a folder.

Then another European application (2) picks the same csv file from that folder and process it.

But as the csv file is in comma seperated format, application (2) is not able to process the csv file. It needs semicolon seperated csv file (European standard)

Therefore I need a batch program which converts the comma separated csv file to semicolon seperated csv file



Report •

#3
February 9, 2011 at 04:53:09
:: ==========================================
::
:: tosemi.bat Wed 09-02-2011 19:49:22.28
@echo off > newfile & setLocal enableDELAYedeXpansion

for /f "tokens=* delims= " %%a in (my.csv) do (
set S=%%a
set S=!S:,=;!
>> newfile echo.!S!
)


=====================================
Life is too important to be taken seriously.

M2


Report •

Related Solutions

#4
February 9, 2011 at 05:27:18
ahamedthaha: It needs semicolon seperated csv file (European standard)
Everyone knows .csv stands for comma separated values, right?

How To Ask Questions The Smart Way


Report •

#5
February 10, 2011 at 02:20:59
Your right..
csv stands for comma seperated values
but that is the requirement..

The use of the semicolon in CSV files (as shown above) is particularly prevalent in Europe, since they may use a comma as a decimal separator. A North American might write 3.14159 while a European might write 3,14159 to represent the same value.


Thank You for your reply


Report •

#6
February 10, 2011 at 02:42:37
@M2, what if there are embedded commas?

GNU win32 packages | Gawk


Report •

#7
February 10, 2011 at 03:21:21
"@M2, what if there are embedded commas?"

I guess you're SOL.

"might write 3,14159"

Lord knows why.


=====================================
Life is too important to be taken seriously.

M2


Report •

Ask Question