csv

How to merge CSV files in Java

My first csv file looks like this with header included(header is included only at the top not after every entry): NAME,SURNAME,AGE Fred,Krueger,Unknown .... n records My second file might look like this: NAME,MIDDLENAME,SURNAME,AGE Jason,Noname,Scarry,16 .... n records with this header template The merged file should look like this...

Import CSV into SQL Server with bulk insert - with child entities?

I need to import 100.000 rows from CSV file into SQL Server database. I use CsvReader to read the file. File contains flat data and child entities data like so: No Name Age ... Address1 Address2 ... AddressN 1 Alex 20 London Paris 2 Brian 30 New York Records will be inserted into main Clients table and child...

The best way of creating .CSV files in java

I need to create MAX file for using it in Xerox FreeFlow Process Manager. Most of the data is static, and is just poped out of the mssql database. (And it has nothing to do with Excel.) What is better in this situation to use? some tools like CSVReader/CSVWriter? Or is it more useful to handle it with the Apache Velocity? ...

Custom View Engine vs Custom Action Result

Hey! I have a scenario where the user have the option to click the button "download" and I should create a csv file, that contains history data, and then let the user save the file locally. As I haven't done this before, I started to look around for how to do this and basically came across both Custom View Engine, and Custom Action Resu...

php parse file not sure what format

Hello, I have an piece of hardware that returns tempature data etc. I am not sure what format this is though. I would like to parse it with php any suggestions on the best or easiest way to parse the data. I will be storing the data in a mysql database and this data will be inserted one every 30 seconds. Below is the data: {name:"Envi...

SQL Server: Import and Export CSV

I am working on SQL Server 2000. As you know, there is an application that's shows query results (Query Analyzer) The data is shown there, on a grid, and you can save that grid in a csv file. That's great. Now, I want to INSERT those csv values into a Table. Does SQL Server provide any method?? And I mean, automatic or semi-automatic me...

Java Regex to remove start/end single quotes but leave inside quotes

I have data from a CSV file that is enclosed in single quotes, like: 'Company name' 'Price: $43.50' 'New York, New York' I want to be able to replace the single quotes at the start/end of the value but leave quotes in the data, like: 'Joe's Diner' should become Joe's Diner I can do updateString = theString.replace("^'", "").repl...

CSV with multiple header rows; import into mysql using php

Hi, I've got a CSV file with two sets of data in it [its pulled of a temperature logger]. I'm wondering if there's a way to import the first two rows as one set of data and the rest as a second set of data. I'm familiar with PHP, but have never had to do anything like this. I've attached a subset of data below. Any help or direction woul...

How to enclose every cell with double quotes in Google docs spreadsheet

I have utf-8 data which I would like to save as csv. My old version of Excel mangles utf-8, so I have to resort to using google's spreadsheet which handles utf-8 beautifully. Some of my data have commas in them, so I must wrap every field of data in the csv with double quotes. I have hundreds of lines, so it would take some time to do it...

Using a lambda expression to avoid using a "magic string" to specify a property

I am writing a service to take a collection of objects of a particular type and output its primitive, string, and DateTime types to a string in CSV Format. I have both of the below statements working. I find the the lambda based version to be much cleaner. Magic String Version string csv = new ToCsvService<DateTime>(objs) .Exclude(...

How to break a large CSV data file into individual data files?

I have a CSV file the first row of which contains the variables names and the rest of the rows contains the data. What's a good way to break it up into files each containing just one variable in Python? Is this solution going to be robust? E.g. what if the input file is 100G in size? I am trying to perform a divide conquer strategy but i...

HSQLDB: Easy way to have all created files deleted after closing connection?

I have an app/tool which reads from a CSV file and writes to another, processing it using HSQLDB. I want to have the CSV file as the only output, and the database files should disappear after the process finishes. I tried to use mem storage, but that prevents HSQLDB to write to the CSV file. I also tried to DROP SCHEMA before closing ...

ASP.net script to create CSV file

Hi, I have a PHP script which writes a CSV file when a form is submitted from my Flash application. I need the same script for a Microsoft server so if this can be done in Asp.NET, I would appreciate it if someone knows where I can find something like this? What I need it to do is to update the CSV file every time someone submits the f...

Java Escaping String for Storage in csv file

If want to store user created strings in a csv file. Is there a preferred library to use for Escaping the string or should I write my own function? ...

smallest learning curve language to work with CSV files

VBA is not cutting it for me anymore. i have lots of huge excel files to which i need to make lots of calculations and break them down into other excel/csv files. i need a language that i can pick up within the next couple of days to do what i need because it is kind of an emergency. i have been suggested python, but i would like to che...

python beginner questions

i just installed python i am trying to run this script: import csv reader = csv.reader(open("some.csv", "rb")) for row in reader: print row i am running on windows. do i have to type each line individually into python shell or can i save this code into a text file and then run it from the shell? where does some.csv have to be i...

csv python questions

i am opening a csv file like this: import csv reader = csv.reader(open("book1.csv", "rb")) for row in reader: print row how can i replace the value in column 3 with its log and then save the result into a new csv? ...

python csv: getting subset

here is a snapshot of my csv: alex 123f 1 harry fwef 2 alex sef 3 alex gsdf 4 alex wf35 6 harry sdfsdf 3 i would like to get the subset of this data where the occurrence of anything in the first column (harry, alex) is at least 4. so i want the resulting data set to be: alex 123f 1 alex sef 3 ale...

use vba creat csv but the format of csv is not correct.

I use the code as below. Private Sub CommandButton1_Click() Const File$ = "C:\CsvfileTest2.csv" Dim Fso, MyFile Set Fso = CreateObject("Scripting.FileSystemObject") Set MyFile = Fso.CreateTextFile(File, True) MyFile.Close With CreateObject("ADODB.Stream") .Open .LoadFromFile File .Pos...

Help building a random name generator

Hi all, As a teacher I am looking to create a random name generator to use with my classes. I don't know much but I am willing to learn. I want my random name generator to be able to load class lists from an external csv or txt file - I want the random name generator to be able to recognise the time and load the pre-defined class for tha...