Change files to .csv from .xls (Full Version)

All Forums >> [Web Development] >> ASP, PHP, and Database



Message


dzirkelb1 -> Change files to .csv from .xls (6/18/2009 15:12:27)

I have around 500 files in a directory i would like to change from .xls to .csv...for some reason, they are not saved correctly as csv files, and I need to change them all at one click instead of one at a time.

So, how would I go about doing that? I would have the necessary permissions already.




swoosh -> RE: Change files to .csv from .xls (6/18/2009 16:11:17)

Don't think you're going to be able to do all of them without the help of third party software, but of course that is gonna cost. Link below is for one that will do exactly what your looking for but is it worth the price?

http://www.ozgrid.com/Services/convert-excel-csv.htm




dzirkelb1 -> RE: Change files to .csv from .xls (6/18/2009 16:22:20)

All of the files are labled 1.xls all the way up to 530.xls. I've renamed files through asp code before, I just do not remember how to do it. Once I get the code to rename one file, then i can put it into a loop and be able to do it.




swoosh -> RE: Change files to .csv from .xls (6/18/2009 16:39:45)

This any help?
http://www.devasp.net/net/articles/display/141.html




ou812 -> RE: Change files to .csv from .xls (6/18/2009 21:27:37)

Not sure if you're talking about programatically, or perhaps just a command window. If a command window just use the ren command.
ren *.csv *.xls
http://www.computerhope.com/renamehl.htm

If asp, you could try this:
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/filesfolders/files/#RenameFiles.htm




swoosh -> RE: Change files to .csv from .xls (6/18/2009 23:16:01)

quote:

If a command window just use the ren command.
ren *.csv *.xls


Just beware that this will work fine with the renaming and using the files within Excel. However, for text editors such as notepad they will be corrupt.




ou812 -> RE: Change files to .csv from .xls (6/18/2009 23:29:56)

quote:

However, for text editors such as notepad they will be corrupt.


Huh? Renaming a file corrupts it? Can you explain a bit? Clearly, I'm not getting it. [8|]




swoosh -> RE: Change files to .csv from .xls (6/19/2009 0:03:32)

hi Brian,
Maybe corrupt was the wrong word[:-]

not just renaming but changing the format from xls to csv doesn't really convert the format correct? try saving an excel file and renaming it with a csv extension. I believe Excel will still be able to read it but I also think a text editor would have a problem with it because it wasn't originally saved in the csv format........I could be mistaken




ou812 -> RE: Change files to .csv from .xls (6/19/2009 1:10:43)

Ah, got it. I thought maybe you experienced something strange when renaming different types of files. But yes, you are correct, renaming does nothing at all to the file except allows a program to read it by default. If the contents are really CSV then notepad, or any text type editor will have no problem with it. And as you said, if you renaming an XLS file, that was created as a spreadsheet, to a CSV extension, or txt or something, notepad and other text editors will not be able to view them very nicely.

Thanks for clarifying, and sorry for my confusion. [:-]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.09375