Your daily news about web technology, interface and design.

Sorry about the current website getting messy,
we are currently moving to our new wordpress platform "webmasterbulletin.net".
> Developper's Zone > $$$ : commercial products
 
Excel : export to a text file with a chosen delimiter

I was sorry about the fact that stupid excel cannot export to text file other than csv (comma separated values) or tsv (tab). Here is the solution :

well you 'll have to write it yourselves guys : MS dudes have not thought about the fact that some values in cells could have commas or tabs.


The use of a macro is required to be able to export an excel sheet to a file with a chosen delimiter, such as pipe (|)


here is the link to the source code for such a macro, the page also deals with import which is less problematic as it is more versatile :

http://www.cpearson.com/excel/imptext.htm#Export


For mysql addicts, xls2mysql converts xls sheets to mysql queries. Going through mysql can be another way to convert Excel to CSV, which doesn't need an Excel installation as the Excel sheet is in that case interpreted by PHP.




Comments are temporarily disabled because of SPAM
 Discussion / comments
2007-06-20
Sasikanth Malladi comments from Woodbridge, NJ :
THe above trick of resetting the default number separator in Windows to a "|" from a "," doesn't work.
Sashi
 Post a reply to this comment
2005-08-29
robert comments :
Changing the list separator in MS EXCEL (2003!) isn't it all. You have to change the decimal symbol too. e.g. set the German (AUSTRIA), customize the list separator from ";" to "," => it won't work. ";" is used. But when you change the decimal symbol to "." and the list separator to "," => then it works ... mysterious .. and don't forget to start MS EXCEL between each change ;-)
 Post a reply to this comment
2005-07-15
Dark Elf comments from Dark Lands of Moria ;-) \m/ \m/ :
Thanks for the tip....!! Searched a lot for this one!! Am surprised that Microsoft does not offer this tip !! But then again Microsoft !!! aaaarggggghh...Excel rocks though!! \m/ \m/
 Post a reply to this comment
2005-07-10
Martin Naranjo comments :
Yes, you can set a pipe rather than a comma as a delimiter. It does not depend completely on Excel. It depends on Windows. The quickest way is to save the file as a CSV file.

To change the default on your PC to a pipe rather than a comma bring up your default options window by clicking Start -> Settings -> Control Panel -> Regional Settings.

Click the "Number" tab and in the "List Separator" field, replace the current default separator with the one you want to use (let's say a pipe symbol | ).

Click "OK" to save the change and close the window. You can now save Excel files as pipe delimited files by simply doing the following in Excel:

Open or Create a new file in Excel.
Click File => Save As on the menu bar.
In the "File Type" drop down, select "CSV (comma separated values) *.csv".
 Post a reply to this comment


Most read :
  • php move file (50971 readers).
  • Excel : export to a text file with a chosen delimiter (49177 readers).
  • Replace string in file with sed (34910 readers).
  • Oracle autoincrement columns (26684 readers).
  • mysql replace string in a query (22743 readers).
  • String replace (21876 readers).
  • Shell : rename all files in subdirectories to lower-case (21517 readers).
  • Flash Page turn effect : goto PAGEFLIP (20144 readers).
  • Read Excel Spreadsheet with PHP (19902 readers).
  • Tip : get yesterday's date (19259 readers).

  • download webxadmin
      Support webxadmin !
    donate
    Donators get sitescope OS
      > About webxadmin
    > Site map
    > Contact the author :
    webxadmin at free dot fr

    Pôle Ouest - web design services and opensource consultancy - Quimper Brest Lorient Douarnenez Carhaix
    Google

    Pôle Ouest - web design services and opensource consultancy - Quimper Brest Lorient Douarnenez Carhaix

    Excel2Mysql converts Excel sheets to Mysql insert queries

    Flash Photos Viewer : Eyelash

     Use OpenOffice.org



    Free Software and Game Downloads