Forum Moderators: travelin cat

Message Too Old, No Replies

Uploading CSV files from Mac

         

ron_ron

11:04 am on May 18, 2004 (gmt 0)

10+ Year Member



Has anyone noticed any problems uploading .csv files to webbased databases? Is there a problem with encoding?

Macguru

11:52 am on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi ron_ron,

I had encoding problems when datas where not plain ASCII text. Special caracters came out garbled between Mac and *NIX server. There is also that 'line endings' issue that can be interpreted as linefeeds or carriage returns.

Can you please tell us more about the software and platforms?

timster

2:09 pm on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, what MacGuru said, plus please let us know how the files are being uploaded.

ron_ron

2:32 pm on May 18, 2004 (gmt 0)

10+ Year Member



I use a service called LinksManager to create a kink directory. I am trying to upload my links into the various categories of the link directory by CSV. I create my csv files in both excel and a text editor on a Mac (OSX) and then do a browser upload. But the server indicates an error each time. It does not says what the error is.

The file is supposed to be comma separated for the fileds and return separated for the end of record delimiter. It also requires headers. I have it set up like they tell you to but it doesn't work.

I wonder if it has anything to do with creating the files on the Mac. It goes on an UNIX server. Note sure what the LinksManager database is.

timster

6:53 pm on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the details. Yes, it sounds like it could be a line-ending issue. Worth a shot anyway.

Your blitz tutorial on line endings follows:
Mac OS Line Endings: Carriage returns, ASCII : 13
Unix Line Endings: Line Feeds, ASCII: 10
Windows Line Endings: Carriage Return + Line Feed (CRLF)

If the online app is expecting a different line ending, it's going to read your Mac file as one overlong record.

You may be able solve this simply by saving out of Excel int CSV Windows format (lower down the list).

BTW, do you need to fix a bunch of files that already exist?

ron_ron

3:05 am on May 19, 2004 (gmt 0)

10+ Year Member



"You may be able solve this simply by saving out of Excel int CSV Windows format (lower down the list)"

I could not find CSV Windows format in my version of excel. I have Office : Mac, v.X

jamesa

11:55 pm on May 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Two things to watch for are line breaks, and I guess you'd call it meta data.

Line breaks:
Save your file with Unix or DOS line breaks. A good text editor, like BBEdit (even the free one) will let you do this. On my machine TextEdit save files with Unix line breaks as well.

Meta Data (for lack of a better term):
If you're creating the CSV text files in TextEdit, make sure you select Make Plain Text form the Formatting menu. Otherwise it creates an RTF file which includes a bunch of extra formatting data, like Word would do.