csv

Azure data factory data flow silently NULLing date column

只愿长相守 提交于 2021-01-29 09:57:35
问题 I'm trying to use Azure Data Factory to upsert a CSV into an Azure SQL table. All seemed well until I checked the results. One of the columns is a nullable date. The CSV contains a value like so 1/2/2020 12:00:00 AM . The data flow silently inserts a NULL instead of throwing an error because it didn't like the input. So how can I get my data flow to convert the string to a datetime properly, and then to error out on issues like this in the future? I really don't want silent failures and bad

I want to delete rows from line 2 to a specific numbers in CSV file, but it deletes all from the file

允我心安 提交于 2021-01-29 09:29:35
问题 Currently, It is deleting everything in CSV, also How can I make a default number so, It will delete from line 2nd to a specific row. This is what I'm doing import csv user_input = input("Please enter a row name to be deleted.") read = open('color.csv', 'rb') write = open('color.csv', 'wb') writer = csv.writer(write) for row in csv.reader(user_input): if row == input: writer.writerow(row) read.close() write.close() print('Used colors names deleted') 回答1: The main reason is deletes all from

How to split a comma-separated value to columns

末鹿安然 提交于 2021-01-29 09:24:34
问题 I have a table like this Value String ------------------- 1 Cleo, Smith I want to separate the comma delimited string into two columns Value Name Surname ------------------- 1 Cleo Smith I need only two fixed extra columns 回答1: CREATE FUNCTION [dbo].[fn_split_string_to_column] ( @string NVARCHAR(MAX), @delimiter CHAR(1) ) RETURNS @out_put TABLE ( [column_id] INT IDENTITY(1, 1) NOT NULL, [value] NVARCHAR(MAX) ) AS BEGIN DECLARE @value NVARCHAR(MAX), @pos INT = 0, @len INT = 0 SET @string =

How to print data from API call into a CSV file

て烟熏妆下的殇ゞ 提交于 2021-01-29 09:23:12
问题 I'm using the Alpaca trading API and want to export data from a function call into a CSV file. When I run a call like this: closed_orders = api.list_orders( status='closed', limit=2, nested=True # show nested multi-leg orders ) print(closed_orders) I get back: [Order({ 'asset_class': 'us_equity', 'asset_id': '8a9-43b6-9b36-662f01e8fadd', 'canceled_at': None, 'client_order_id': 'e38a-b51c-349314bc6e9e', 'created_at': '2020-06-05T16:16:53.307491Z', 'expired_at': None, 'extended_hours': False,

How to convert a txt file to csv file in cells

ε祈祈猫儿з 提交于 2021-01-29 09:13:17
问题 I am trying to convert a txt file in the following format: NOTE Date : 2/12/2019 Name : SomeName Amount : 9000.0 Total : 59000.0 3ABA2363F5305877265757265784B2EB94ABxxxxxxxxxxxxxxxx To a csv file, omitting NOTE and in cell format: Date,Name,Amount,Total,Signature 2/12/2019, SomeName,9000,59000,3ABA2363F5305877265757265784B2EB94ABxxxxxxxxxxxxxxxx What i have archived to do so far is: Date,Number,Amount,Total,Signature ['NOTE'],"['Date', '2/12/2019']","['Name', 'SomeName']","['Amount', '9000.0'

Take json string from ESP8266WiFi, and save it as a string variable in NodeJS to write a CSV file

余生颓废 提交于 2021-01-29 09:02:24
问题 I want to take a JSON string of DHT22 sensor value (temperature and humidity) from this ESP8266WiFi through WiFi. #include <DHT.h> //library DHT.h #include <ESP8266WiFi.h> #define DHTPIN 14 // GPIO14 #define DHTTYPE DHT22 // DHT 22 (AM2302) DHT dht(DHTPIN, DHTTYPE, 15); const char* ssid = "myhotspot"; const char* password = "mypassword"; WiFiServer server(80); void setup() { Serial.begin(115200); dht.begin(); Serial.println(); Serial.print("Wifi connecting to "); Serial.println( ssid ); WiFi

Plot csv file with multiple rows using gnuplot

老子叫甜甜 提交于 2021-01-29 08:52:18
问题 I have a csv file which contains 500 rows and 100 columns. I want to plot the data in the way that: Each row represent a curve on the graph. Every column represents a value on the curve (100 values). 500 such curves on the graph. The code: set xrange [0:100] set yrange [0:20] set term png set output 'output.png' set datafile separator ',' plot 'myplot.csv' But this does not seem to work. How can I configue gnuplot to achieve that? Edit: The data is in this format (Shortened): 7.898632397,7

Remove values from rows under specific columns in csv file

天大地大妈咪最大 提交于 2021-01-29 08:30:54
问题 I'm currently trying to remove specific values from rows under specific columns in a CSV-file. Whats the best way of doing this? Is it to use a XSLT map file in the code or doing this only by code? (Using c#) What I want to do is this: BEFORE MANIPULATION: id, name, email, phoneNumber, dob 1,John Doe,JohnDoe@mail.com,123456789,1988-08-08 2,Jane Doe,JaneDoe@mail.com,987654321,1987-07-07 AFTER MANIPULATION: id, name, email, phoneNumber, dob 1,John Doe,,,1988-08-08 2,Jane Doe,,,1987-07-07 As you

Convert json array with values only to csv using jq

帅比萌擦擦* 提交于 2021-01-29 08:24:20
问题 I have a below JSON and I need to convert it to a CSV. The problem I'm having is that those values have no key. Ideally I would like CSV to look like this, I just don't know how to do it using jq. CSV year;points;surname;name;point1;points2;points3;city;district;url 2020;54;Smith;John;;;London;Waterloo;URL 2015;380;Helen;Smith;;;New York;Manhattan;URL JSON { "draw": 0, "total": "44", "filtered": "8", "data": [ [ "2020", "54", "Smith ", "John", "", "", "", "London", "Waterloo", "URL" ], [

Difference between loading a csv file into RDD and Dataframe in spark

孤街浪徒 提交于 2021-01-29 08:19:58
问题 I am not sure if this specific question is asked earlier or not. could be a possible duplicate but I was not able to find a use case persisting to this. As we know that we can load a csv file directly to dataframe and can load it into RDD also and then convert that RDD to dataframe later. RDD = sc.textFile("pathlocation") we can apply some Map, filter and other operations on this RDD and can convert it into dataframe. Also we can create a dataframe directly reading a csv file Dataframe =