concatenation

How to concatenate column titles if cells in a range contains a specific text/character

依然范特西╮ 提交于 2019-12-14 03:57:38
问题 I am trying to create a list of column names based on specific criteria (if the cell contains "*"). Basically, I am trying to get Excel to automatically create the fourth column: (1) A B C List (2) Bob* Mike John* A; C (3) Jane Lisa* Brenda* B; C *Please note that I have over 100 columns I am a little familiar with VBA and the Concatenate function but I'm no expert. Thanks for taking the time to read this post! Irene 回答1: Multiple options really: Option 1: Excel TEXTJOIN If you have an Excel

R: Add single quote to string

本小妞迷上赌 提交于 2019-12-14 03:48:06
问题 I try to add single quotes to a string but don't see how to do it. For instance I would like to replace ABC by 'ABC'. I have played with paste, cat, print but don't see how to do it. Any solution? Thanks, Vincent 回答1: Just use paste : R> paste("'", "ABC", "'", sep="") [1] "'ABC'" or the new variety R> paste0("'", "ABC", "'") [1] "'ABC'" 回答2: Maybe use sQuote ? sQuote("ABC") # [1] "'ABC'" This (like its sibling dQuote ) is frequently used to put quotes around some message or other text that's

Python: Concatenate many dicts of numpy arrays with same keys and size

ε祈祈猫儿з 提交于 2019-12-14 03:34:34
问题 I have a function called within a loop that returns a dict (dsst_mean) with roughly 50 variables. All variables are numpy arrays of length 10. The loop iterates roughly 3000 times. I'm current concatenating towards the end of each loop so that I have an 'dsst_mean_all' dict that grows larger on each iteration. source = [dsst_mean_all, dsst_mean] for key in source[0]: dsst_mean_all[key] = np.concatenate([d[key] for d in source]) It works, but I know this isn't efficient. I also have problems

UPDATE and SELECT table concatenation [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-14 03:25:52
问题 This question already exists : Access SQL: syntax error(missing operator) Closed last year . My task is: Choose all profitable flights. transportation is a general information about the flight. ticket includes information about a number of tickets and their cost. So, how to concatenate UPDATE and SELECT table in order to find only those rows with profit greater than 0. UPDATE table should go first because profit field is empty UPDATE transportations set profit =((transportations.ticket.cost*

How to combine 2 4-bit unsigned numbers into 1 8-bit number in C

泄露秘密 提交于 2019-12-14 02:08:40
问题 I have 2 4-bit numbers (X0X1X2X3 and Y0Y1Y2Y3) and I want to combine them so that I would create an 8-bit number like that: X0X1X2X3 Y0Y1Y2Y3 => X0Y0X1Y1X2Y2X3Y3 I know how to concatenate them in order to create the X0X1X1X3Y0Y1Y2Y3 but I am stuck on how to compose them in the pattern explained above. Any hints? 回答1: Here's a fairly direct way of performing this transformation: uint8_t result; result |= (x & 8) << 4; result |= (y & 8) << 3; result |= (x & 4) << 3; result |= (y & 4) << 2;

conditionally concatenate text from multiple records in vba [duplicate]

那年仲夏 提交于 2019-12-13 22:25:43
问题 This question already has an answer here : conditionally concatenate text from multiple records in vba (1 answer) Closed 5 years ago . UniqueID Description ConsolidatedText Str1 Here is a sentence Here is a sentence Str2 And another sentence. And another sentence. And some words Str2 And some words Str3 123 123 Str4 abc abc ### Str4 ### OK - I'll try that again. Ignore previous post with identical title and unformatted code!! I have a number of records (~4000) each with a UniqueID value (text

Concate Primary Keys in SQL

让人想犯罪 __ 提交于 2019-12-13 22:20:04
问题 I want to concate Primary Keys of multiple tables in SQL directly. I used below query to concate three primary keys with a hyphen between them but the SQL skipped the hyphen and sum up the primary keys and result in a single value. SELECT CID + '-' + RID + '-'+ CGID As [IdCombination] ... where CID , RID and CGID are the Primary Keys of three SQL Tables. How it skipped the string part in query ? Any help would be highly appreciated. Updated For Example : The Values of CID , RID and CGID are 3

pandas: duplicate rows from small dataframe to large based on cell value [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-12-13 21:23:48
问题 This question already has answers here : Mapping columns from one dataframe to another to create a new column [duplicate] (2 answers) Closed last year . I have two sets of numerical data. One is much larger than the other. The same data from the smaller set applies to the larger set multiple times. For example, where B is the data I need to add to the larger set and C is the number of times each value A is referenced in the large set: Small set: A B C 123 1 2 456 5 3 Large set: A D 123 45 123

Concatenation of string and looped value

大城市里の小女人 提交于 2019-12-13 20:39:34
问题 For Each Number In accountNumber Dim urlString As String urlString = "http://www.prad.org/CamaDisplay.aspx?OutputMode=Display&SearchType=RealEstate&ParcelID=" & accountNumber.Value Set dataSet = ActiveSheet.QueryTables.Add( _ Connection:="URL;urlString, _ Destination:=ThisWorkbook.Worksheets(2).Range("A1")) I am attempting to loop through the values Number in a column range accountNumber , adding them to the end of the URL given. This will ultimately visit multiple webpages, adding to the

Trouble concatenating two strings

被刻印的时光 ゝ 提交于 2019-12-13 17:30:42
问题 I am having trouble concatenating two strings. This is my code: info = infl.readline() while True: line = infl.readline() outfl.write(info + line) print info + line The trouble is that the output appears on two different lines. For example, output text looks like this: 490250633800 802788.0 953598.2 802781.968872 953674.839355 193.811523 1 0.126805 -999.000000 -999.000000 -999.000000 I want both strings on the same line. 回答1: There must be a '\n' character at the end of info . You can remove