csv

Loop through a .csv file in R, computing relative frequencies?

Hello, I'm new to R and I'm trying to create a .R script that will open up a .csv file of mine and compute some frequencies. There are headers in this file and the values associated with them are either 1,0,NA, or -4. What I want to do is go through each vertical row and then compute the frequencies of them. I'm sure this is an easy scri...

php arrange table content from horizontal to vertical

Hello I have a script which read a csv file. <?php echo '<table border="0" cellspacing="1" cellpadding="1" class="sortable" border="1"><caption>Title Here</caption> <thead><tr><th class="header">Time:</th><th class="header">Value 1:</th><th class="header">Value 2:</th><th class="header">Value 3:</td class="header"><th class="header">...

Import CSV file in mysql with email validation

I have a 2 column in my subscriber table. Name | email I want to import a CSV file data in respective column with validation of email column. I have done uploading CSV part, but i don't know how to insert data with email validation. How I can do this, I have search allover net but I can't find any working answer on it. Please help ...

Import database from File PROGRAMMATICALLY?

Hi guys!! Is there a way to programatically import an entire database from a file with SQL?? (either .CSV , .SQL and .DB files are fine) Thanks!! EDITED AFTER TO CLARIFY: I am interested in a solution that is Database independent (has to works with all types of databases (Mysql, SQL Server, PostGres, Oracle...) ...

InstallShield 2009: detect system CSV separator and update INI value

OK as you may know the CSV separator in French is not , it's ;. We need to deploy an application to both French and English systems. What I would like to do is that InstallShield would detect the system CSV separator and then save this value in an INI installed with the application (I know, INIs are outdated by the registry a long time ...

How to use JSP/JSTL to create a CSV file

Hi, I have created a jsp file, with a simple table on it. I would like to create another jsp file that users can open in Excel or save as an xls. This is my entire jsp file, this creates a csv file which opens in Excel when a link is clicked: <%@ page contentType="text/html;charset=windows-1252"%> <%@ taglib prefix="c" uri="http://jav...

Exporting sqlite data in pdf and csv format

Hi Fellas, I am new in iPhone application development. In my application i need to export the data that i have in sqlite into pdf and excel sheet format, also after that i have to give a provision to attach that generated pdf or csv files in an email and send it to same. Kindly help!...I am really screwed. I need codes for it Thanks in...

Access Data Project Importing CSV File In VBA

Hi Every now and then I come across a problem with an old system one of my colleagues has developed. They tend to have thousands of lines of code to do a simple thing like importing a csv file. Currently the vba process is: open excel application create new worksheet populate the csv file into excel add the header names to the f...

How do I modify a large json string?

Dead silence! Not often you experience that on Stackoverflow... I've added a small bounty to get things going! I've built a json document containing information about the location of various countries. I have added some custom keys. This is the beginning of the json-file: { "type": "FeatureCollection", "features": [ { "type": "Feature"...

How can I parse a CSV into array with first value as key?

So I have a CSV file that looks like this: 12345, Here is some text 20394, Here is some more text How can I insert this into an array that looks like so $text = "12345" => "Here is some text", "20394" => "Here is some more text"; This is what I currently had to get a single numerical based value on a one tier CSV if ...

dealing with double tabs in a tab delimited file in PHP

$lineArray = preg_split('/\t\s*(?=([^"]*"[^"]*")*[^"]*$)/', $line); Above code snippet it to split a tab delimited file where tabs are not inside double quotes. It works fine except the cases where there double tabs (missing fields). Basically PHP sees only one tab when there are two. Is there a tab-width option? ...

using Python to import a CSV (lookup table) and add GPS coordinates to another output CSV

So I have already imported one XML-ish file with 3000 elements and parsed them into a CSV for output. But I also need to import a second CSV file with 'keyword','latitude','longitude' as columns and use it to add the GPS coordinates to additional columns on the first file. Reading the python tutorial, it seems like {dictionary} is what ...

c#: which csv reader should i use?

i have a python script that i need to convert to c#. the main thing that the python does is it takes a csv file, does a bunch of calculations to it, and creates csv subsets. which csv library do you recommend that i use for this type of work? ...

How to import a csv file using python with headers intact, where first column is a non-numerical

This is an elaboration of a previous question, but as I delve deeper into python, I just get more confused as to how python handles csv files. I have a csv file, and it must stay that way (e.g., cannot convert it to text file). It is the equivalent of a 5 rows by 11 columns array or matrix, or vector...which ever. I have been attempti...

Select columns of data from .txt to .csv

hi there! I am quite new to python (well more like I've only been using it for the past week). My task seems fairly simple, yet I am struggling. I have several large text files each with many columns of data in them from different regions. I would like to take the data from one text file and extract only the columns of data that I ne...

How to convert the NSMutableArray to CSV file on iPhone?

Hi, everyone, I am writing an iPhone application, which contains a function. It can convert the NSMutableArray to a CSV file. However, I don't know how to do. Can anyone help me to do this? Thank you very much. // ------ Update ----- Thank you for everyone reply. Actually, the array contains the objects of the elements, but I can co...

Splitting the content of a cell in a CSV file into separate cells

Hi, I have a large CSV file full of organisations names and addresses. I need to hand over a clean csv file to our developers who need to build a database around them. The problem is that the street names and numbers are in the same cell, and they need to be separate, so that we can filter organisations by street names. So, I would lik...

How to deal with NaN's when reading in a csv file in C++

Hi, I'm reading in a csv file of time-series data into a C++ program. My data however contains some NaN's. For example: 1-Jul-2010, 1.0 2-Jul-2010, 2.0 3-Jul-2010, NaN 4-Jul-2010, 3.0 To deal with this I wrote a short script in Matlab which replaces all the NaN's with 0.0 - I then read in the new file without the NaN's. I...

how to extract a subset of a data frame based on a condition involving a field?

I have a large CSV with the results of a medical survey from different locations (the location is a factor present in the data). As some analyses are specific to a location and for convenience, I'd like to extract subframes with the rows only from those locations. It happens that the location is the very first field so yes, I could do it...

Retrieve stock quote in CSV format and display on website

I am trying to retrieve a stock quote for EAG and embed it into a website. The only info I need to get is the current price and the change. I know Yahoo offers an API and the URL I want to use is http://download.finance.yahoo.com/d/quotes.csv?s=EAG&amp;f=l1n1 What I am lacking is the knowledge of how to parse the CSV file and display...