On Feb 18, 2008 5:23 PM, Andrew Ballard <aballard@xxxxxxxxx> wrote: > > On Feb 18, 2008 12:02 PM, Edward Kay <edward@xxxxxxxxxx> wrote: > > > > > > On Mon, February 18, 2008 10:36 am, Jay Blanchard wrote: > > > > [snip] > > > > That's funny... MS defaults to tabs for a file whose extension is .csv > > > > which is an acronym for (C)omma (S)eparated (V)alues. > > > > [/snip] > > > > > > > > Welcome to Microsoft....where do we want you to go today? > > > > > > I think it defaults to whatever you last used, not to a specific choice. > > > > > > > That would seem to be a possibility. I can quite happliy double-click a > > .csv > > file and have it open correctly in Excel. > > > > > Yes. And Excel seems to prefer .txt for tab delimited. However, .txt is > usually opened by Notepad by default, so you have to right-click and tell it > to Open With... Excel. When I do this, it reads it as columnar data rather > than a single column. > > Andrew > I need to spend some time looking at *exactly* what is happening in various scenarios from the sound of things. My data source used to supply comma separated files which open just fine in Excel (and still do) but they have recently changed to tab delimited. These open fine in Excel but if you go to save the file it auto-selects .txt !! I'm currently opening the tab delimited files in Excel and doing a Save As to save as CSV. Excel then handles the file OK and my app likes it when imported (using fgetcsv with , delimiter). As I type I'm thinking I should make my import script a bit more "intelligent" and check for ',' or '\t' in the incoming file and proceed accordingly... My biggest gripe with tab delimited files is that they are quite a bit bigger than comma delimited files so I may have to split the large files I receive into smaller 'chunks' to allow them to be uploaded. One thing I have noticed is that the files I create in my PHP script (The script breaks a large file into smaller files of 25,000 records/rows each.) when opened in Excel (by double-clicking the file in Windows Explorer) came up with an unrecognised file format message for all files except the first. If you ignore this message the tab delimited files open OK but the comma separated ones do not. The "except the first" made me think that there may be something "hidden" at the beginning of the file to say what type of data follows. I can probably code around the problem but I'd rather not have to but from the sound of things I'd need to get M$ to change.... -- Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php