csv

CSV to XLS linux script

I need a script to convert a comma seperated csv file to an excel xls file. I tried a python script online but i couldn't install the correct version of python to install a mod/dependency the script required. What is the best solution? ...

Need help parsing results from ldap to csv

Hi, I am trying to create a script to generate a csv file with the results of some ldap queries using Net::LDAP but I'm having troubles skipping incomplete lines if one element of the @attributes array is blank. my @attributes = ('cn', 'mail', 'telephoneNumber'); So for example, if a user has no mail listed, or no telephoneNumber li...

How to find difference in csv record

Is there an algorithm or diff-like utilities to find difference between two csv files? Example: file1 ------- key1,value1 key2,value2 key3,value3 key5,value5 key7,value7 file2 ------- key1,value1 key3,value3 key4,value4 key5,value5 key6,value6 With this diff-like utilities it will output 3 types of records: Records that only exists...

Preserving hierarchy when converting .csv file to xml or json

Hello I have a question concerning translating data from a CSV into XML or JSON where it is essential to preserve the heirarchy of the data. For example, if I have CSV data like this: type,brand,country,quantity apple,golden_delicious,english,1 apple,golden_delicious,french,2 apple,cox,,4 apple,braeburn,,1 banana,,carribean,6 banana,...

Writing a PHP file to read from CSV and execute SQL Query

Hi, I would like a PHP script to read the contents from a CSV file in the following format id, sku 1,104101 2,105213 there are a total of 1486 entries, I believe that it's better to use a for loop instead of while !EOF. After that, I would like to perform SQL query on a database named m118, table catalog_product_entity. The query w...

Import CSV file into c#

I'm building a website and one of the requirements is for users to export their contacts from their email client to import them into the site. Because each email client exports their contacts in a slightly different format this has got my head scratching has to the best way to approach it. As I don't know what the fields are, or what th...

converting an Excel (xls) file to a comma separated (csv) file without the GUI

Is there a simple way to translate an XLS to a CSV formatted file without starting the Excel windowed application? I need to process some Excel XLS workbooks with scripts. For this i need to convert the xls file into a csv file. This can be done with a save-as from the Excel application. But, i would like to automate this (so, not open ...

Getting an IOException on multiple writes to a file.

Hey, I have implemented a csv file builder that takes in an xml document applies a xsl transform to it and appends it to a file. public class CsvBatchPrinter : BaseBatchPrinter { public CsvBatchPrinter() : base(".csv") { RemoveDiatrics = false; } protected override void PrintDocuments(System.Collections.Generic.List<XmlDocument>...

Error trapping when a user inputs incorect information

So, i have recently started learning python...i am writing a small script that pulls information from a csv and i need to be able to notify a user of an incorrect input for example the user is asked for his id number, the id number is anything from r1 to r5 i would like my script to be able to tell the user that they have input someth...

How do I write an XSLT to transform XML to CSV?

I'm trying to write an XSLT that will transform an XML document that I have to a CSV file. Here's a sample of the XML: <?xml version="1.0" encoding="utf-8"?> <Import> <Users> <User ID="user_1" EmailAddress="[email protected]"> <Contact FirstName="John" LastName="Doe" /> <Address Street1="808 El...

Split CSV String

How would I split the following string? test, 7535, '1,830,000', '5,000,000' The result should be test 7535 '1,830,000' '5,000,000' I try: Dim S() as string = mystring.split(",") But I get, test 7535 '1 830 000' '5 000 000' Thanks ...

Codegolf: Convert csv to HTML table with smallest amount of code in C#

I'm adding a function to my own personal toolkit lib to do simple CSV to HTML table conversion. I would like the smallest possible piece of code to do this in C#, and it needs to be able to handle CSV files in excess of ~500mb. So far my two contenders are splitting csv into arrays by delimiters and building HTML output search-r...

Get CSV Data from Clipboard (pasted from Excel) that contains accented characters

SCENARIO My users will copy cells from Excel (thus placing it into the clipboard) And my application will retrieve those cells from the clipboard THE PROBLEM My code retrieves the CSV format from the clipboard However, the if the original Excel content contains characters like ä (a with umlaut) then retrieved CSV string doesn't hav...

Have csv.reader tell when it is on the last line

Apparently some csv output implementation somewhere truncates field separators from the right on the last row and only the last row in the file when the fields are null. Example input csv, fields 'c' and 'd' are nullable: a|b|c|d 1|2|| 1|2|3|4 3|4|| 2|3 In something like the script below, how can I tell whether I am on the last line ...

Mysql substring

Hi all i'm trying to migrate to a new mail server so i want to wrote Mysql script to return a table as the following then export the result as CSV file sql statement as the following `select email,clear,email AS domain from postfix_users ` i want to substring any characters preceding the @ and the @ symbol iteself before the domai...

How can I extract user entered fields from a PDF?

I have a savable PDF file that has a bunch of fields that users will fill out. From there I'd like to batch process these files by extracting the user entered fields into a CVS file. Since I'm a .NET guy, I've taken a look at both PDFBox and iTextSharp. With PDFBox I was able to extract the form's text, but not the fields that a user ...

dynamically set number of form instances and save all as csv using php

Im working on a php script to take an existing csv file (we'll call this one the template) and open it in a page and populate editable text fields with it's data between 1 and 50 times(user decides how many), which once edited to the users wishes, can then all be saved into a single combined csv file, separate from the template. I inclu...

C# - Export ListView to CSV

Is anyone aware of a decent CSV export tool for exporting from a ListView? I'm in a mad rush to get a project update out and feature creep means I don't have time to get this final urgent feature implemented myself. ...

Create a new CSV file with template data in php

I am attempting to write a php script, that will take an existing csv file, and open it for edit using the values of that file. <?PHP $file_handle = fopen("test.csv", "r"); while (!feof($file_handle) ) { $line_of_text = fgetcsv($file_handle, 100000); echo "<textarea name=textarea id=textarea cols=40 rows=4>$line_of_text[0]</textarea>"; ...

How do you write code for ID/password info get from CSV and login process?

I thought that I should use JSON for ID/pass storing format once, but I reserched about it, then I finally found that JSON is too difiicult to me, so now I am considering to use CSV. The CSV file would be like this. File name is id.csv. aaa_id,aaa_pass bbb_id,bbb_pass ccc_id,ccc_pass Left colum is id, and right colum is password an...