Question:
What exactly is a CSV file and how exactly do you make one?
H P
2007-05-09 07:49:54 UTC
I am running a site and one of my partners wants me to send data using the .csv file name so he can just import it directly into his database. How do I do this? Are there tutorials out there? Please answer this as soon as possible and as detailed as possible. Thanks

HP
Six answers:
knitting guy
2007-05-09 07:56:52 UTC
CSV are comma delimited files. What you can do is, you create a program that would read the data from your database, and then you would create comma delimited text strings and write to a text file with an extension of CSV.



I am a web developer by trade and have been one for 9 years. I have done exactly the same thing before. I had to write the patients' information into a CSV file and that's exactly how I did it.
planetmatt
2007-05-09 08:13:43 UTC
A CSV or Comma Seperated Value File is essentially a flat file database. It is just a text file that can be opened in Notepad with each record on a new line, and the columns seperated by a delimiter usually a comma hence the name. They are useful in that they are universally recoginsed by all database and spreadsheet applications on nearly every computing platform.



A CSV file would look like this:



customerid,customername,customeraddress

0001,bob,here

0002,jim,overthere

0003,dave,anywhere



Sometimes, if there are commas in the data, you can surround the data with quotes or use an exotic delimitersuch as ¬ which wont be in the data.



If you have the data in Excel, you can do a Save as Text from the File menu to make one. Or you can use the export feature in Access under File - Export after selecting a table if you have the data in an Access database.



Alternativly, if the data sample is small and you have a spare member of staff you dont like very much, you could get them to type it up in Notepad and just save the file with a .csv extension.
2007-05-09 07:55:25 UTC
CSV stands for 'comma separated values' files are commonly used to transport large amounts of tabular data between either companies or applications that are not directly connected. The files are easily editable using common spreadsheet applications like Microsoft Excel.



You usually can't just open them directly, so you have to open a program (Excel or Access for example) and open it through that software/program. Then you will be prompted to format the file contents into the right format and add it to another database file.
polly_peptide
2007-05-09 08:35:15 UTC
If you are using SQL Server, the SSMS has a feature where you can save any result set from the results pane into a CSV file. If you only need to do it one time, this is much easier than writing a program to do it.
Easy Peasy
2007-05-09 07:57:28 UTC
A csv file is just a text file with each item separated by commas. Each record is finished with a return or linefeed



examble

First,Last,Town

Charlie,Brown,nowhereville

,Superman,smallville

james,stewart,hollywood
?
2007-05-09 07:55:38 UTC
Comma Separated Values



Basically, a big list of data separated by commas!



Excel can create them. Or you can do it with Notepad if you're feeling really masochistic.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...