csv

AWK set multiple delimiters for comma and quotes with commas

こ雲淡風輕ζ 提交于 2021-02-08 06:43:33
问题 I have a CSV file where columns are comma separated and columns with textual data that have commas are quoted. Sometimes, within quoted text there also exist quotes to mean things like inches resulting in more quotes. Textual data without embedded commas do not have quotes. For example: A,B,C 1,"hello, how are you",hello 2,car,bike 3,13.3 inch tv,"tv 13.3""" How do i use awk to print the number of columns for each row of which i should get 3 3 3 I thought of using $awk -F'[,"]' but im getting

Is there any way to specify the encoding used in SpreadsheetGear to generate CSV files?

自作多情 提交于 2021-02-08 06:39:39
问题 I am trying to export data containing Unicode characters from our system using Spreadsheet Gear to csv format. (Fine for excel). However because the CSV format is not UTF-8 encoded all the Unicode characters are exported as ??? I am aware that Spreadsheet Gear supports Unicode by having a tab-delimited UTF-8 text file, however we require the comma-delimited file. This is what currently exists (including my check that the Unicode Text file format exports the characters correctly): public

how to split large csv into multiple small csv using linux?

南楼画角 提交于 2021-02-08 06:38:42
问题 Need to split large csv file into multiple files by lines using php and linux. CSV contains - "id","name","address" "1","abc","this is test address1 which having multiple newline separators." "2","abc","this is test address2 which having multiple newline separators" "3","abc","this is test address3. which having multiple newline separators." I used linux comand - split -l 5000 testfile. But it can not able to split csv in correct format because in csv there is one field address having

Replace multiple Strings with Data from CSV

本秂侑毒 提交于 2021-02-08 06:19:14
问题 I've got a CSV (with headers) from all of our access points and want to add them to Zabbix via XML Upload. Since I don't want to create an XML file for each AP manually, I'll try to do this in PowerShell. But - how? I've tried some things with (Get-Content .\Template.xml).Replace() and ForEach-Object , but I haven't had success yet. Filenames are: AP.csv (list of APs, headers are Hostname and IP): Hostname;IP AP1;10.29.202.101 AP2;10.29.202.102 AP3;10.29.202.103 AP4;10.29.202.104 Ap5;10.29

Grouping duplicates in CSV file and ranking data based on certain values

大憨熊 提交于 2021-02-08 06:06:08
问题 I have a CSV file like so - "user_id","age","liked_ad","location" 2145,34,true,USA 6786,25,true,UK 9025,21,false,USA 1145,40,false,UK The csv file goes on. I worked out that there are duplicate user_id's within the file and so what I am trying to do is find out which users have the most 'true' answers for the 'liked_ads' column. I am super stuck on how to do this in Java and would appreciate any help. This is what I have so far to literally just parse the file - public static void main(String

Grouping duplicates in CSV file and ranking data based on certain values

时间秒杀一切 提交于 2021-02-08 06:05:56
问题 I have a CSV file like so - "user_id","age","liked_ad","location" 2145,34,true,USA 6786,25,true,UK 9025,21,false,USA 1145,40,false,UK The csv file goes on. I worked out that there are duplicate user_id's within the file and so what I am trying to do is find out which users have the most 'true' answers for the 'liked_ads' column. I am super stuck on how to do this in Java and would appreciate any help. This is what I have so far to literally just parse the file - public static void main(String

Is there a way stop table from sorting in R

心已入冬 提交于 2021-02-08 05:30:44
问题 Problem setup : Creating a function to take multiple CSV files selected by ID column and combine into 1 csv, then create an output of number of observations by ID. Expected : complete("specdata", 30:25) ##notice descending order of IDs requested ## id nobs ## 1 30 932 ## 2 29 711 ## 3 28 475 ## 4 27 338 ## 5 26 586 ## 6 25 463 I get: > complete("specdata", 30:25) id nobs 1 25 463 2 26 586 3 27 338 4 28 475 5 29 711 6 30 932 Which is "wrong" because it has been sorted by id. The CSV file I

Is there a way stop table from sorting in R

怎甘沉沦 提交于 2021-02-08 05:30:08
问题 Problem setup : Creating a function to take multiple CSV files selected by ID column and combine into 1 csv, then create an output of number of observations by ID. Expected : complete("specdata", 30:25) ##notice descending order of IDs requested ## id nobs ## 1 30 932 ## 2 29 711 ## 3 28 475 ## 4 27 338 ## 5 26 586 ## 6 25 463 I get: > complete("specdata", 30:25) id nobs 1 25 463 2 26 586 3 27 338 4 28 475 5 29 711 6 30 932 Which is "wrong" because it has been sorted by id. The CSV file I

To insert csv file into mysql database table using c# windows form

你。 提交于 2021-02-08 05:10:35
问题 i need to upload that excel file to mysql database table. My Excel File Contains columns like: userid,password,first_name,last_name,user_group AND MySql Database My table(aster_users) Contains many columns like: userid,password,first_name,last_name,user_group,queue,active,created_date,created_by,role .. My code looks like this: String MyCon = "SERVER=*****;" + "DATABASE=*****;" + "UID=root;" + "PASSWORD=******;" + "Convert Zero Datetime = True"; private void btnchoose_Click_1(object sender,

To insert csv file into mysql database table using c# windows form

女生的网名这么多〃 提交于 2021-02-08 05:10:34
问题 i need to upload that excel file to mysql database table. My Excel File Contains columns like: userid,password,first_name,last_name,user_group AND MySql Database My table(aster_users) Contains many columns like: userid,password,first_name,last_name,user_group,queue,active,created_date,created_by,role .. My code looks like this: String MyCon = "SERVER=*****;" + "DATABASE=*****;" + "UID=root;" + "PASSWORD=******;" + "Convert Zero Datetime = True"; private void btnchoose_Click_1(object sender,