Questions tagged [concatenation]

-1

votes
2

answer
25

Views

how str() implement in python?

Definition of savings and result savings = 100 result = 100 * 1.10 ** 7 Fix the printout print("I started with $" + savings+ " and now have $" + result+ " Awesome!") Definition of pi_string pi_string = "3.1415926"
AshishJadhav101
2

votes
3

answer
127

Views

Is String concatenation on assignment efficient?

I know that using the "+" concatenation operator for building strings is very inefficient, and that is why it is recommended to use the StringBuilder class, but I was wondering if this kind of pattern is inefficient too? String some = a + "\t" + b + "\t" + c + "\t" + d + "\t" + e; I guess here the c...
MetallicPriest
13

votes
3

answer
845

Views

How to concatenate lists into one list

I have a list of values, some of which could be lists/collections or single values. In JavaScript notation it might look like: const input = [1,2,[3,4], [5,6], 7]; and I want to get: const concatenated = [1,2,3,4,5,6,7]; So I have this Java code: ArrayList concatenated = new ArrayList(); for (T v :...
MrCholo
0

votes
1

answer
19

Views

printf and string concatenation I think; beginner at this future looks bleak

The code works fine. Just looking for information on how to set up my print f and get the desired results. signs more than one print f statement(s) import java.util.Scanner; public class Coupon { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner...
Ben DeRue
0

votes
0

answer
4

Views

Creating Hyperlink by Concatenating Link Template with Text in Cells - Excel VBA

I am trying to turn a column that has text in it into a hyperlink. The columns will have information which I want to add at the end of the link template. For example, let's say: "/stackoverflow.com/" is my link template Range("A2") = "a_two" and Range("A3") = "a_three" I want to convert cell A2 and...
kkrk
1

votes
2

answer
141

Views

How do I stop a comma being added using CONCAT_WS if column is empty

SELECT CONCAT_WS(',', Col1, Col2, Col3 ) AS combined FROM table_name Currently if I have fields Col1 = 'hello', Col2 = 'Bye', Col2 = 'Goodnight' The above select statement would return hello,Bye,Goodnight which is fine. What if any of the Cols where blank. A Comma would still be added. like hello,,G...
Trying my Best
1

votes
1

answer
1.3k

Views

SASS / SCSS: Interpolate variable from string / name

Is it possible to get a variable by name? I tried building the following function, but it's not working as expected... @function variable-lookup($variable, $suffix: "") { $value: null; @if ($suffix != "" and global-variable-exists($variable+"-"+$suffix)) { $value: #{$variable+"-"+$suffix}; } @else i...
Jake
1

votes
2

answer
70

Views

Concatenate variable in python

I made a variable colonne which returns the number of the column. I'm trying to put it in the selection of my function like that: self.ids.image+colonne+_1 here is my complete view: Button: on_press: root.click_colonne(1) pos: 25,25 size: 100, 500 opacity:0 Image: source: 'image.png' pos: 0,0 size:...
Antoine553
1

votes
2

answer
120

Views

Vectorize string concatenation in matlab

I am doing a project where I would like to vectorize (if possible), these lines of code in Matlab: for j=1:length(image_feature(i,:)) string1b=strcat(num2str(j),':',num2str(image_feature(i,j))); write_file1b=[write_file1b string1b ' ']; end Basically, what I want to get is an output string in the fo...
Arturo
1

votes
1

answer
124

Views

Concatenating previous line with current line based on condition

I need help scripting the following. If the current Line starts with #STOP# and the previous line also starts with "#STOP#" then simply print the line. If current Line starts with "#STOP#" and previous line also starts with "MSG#" concatenate previous line to current line. Input file: #STOP# |packag...
user3238106
0

votes
0

answer
5

Views

How to concatenate 2 columns from another table to 1 table?

I'm setting up a new database and I need to concatenate 2 columns from another table to 1 column. I've tried it with HeidiSQL. Is there a mistake in my code? UPDATE annotationfile SET LABSDTM = CONCAT_WS('T',importfile.Collection_Date, importfile.Collection_Time) ; This is the error message: "Unkno...
ArtCode
7

votes
3

answer
216

Views

Union of two pandas DataFrames

Say I have two data frames: df1: A 0 a 1 b df2: A 0 a 1 c I want the result to be the union of the two frames with an extra column showing the source data frame that the row belongs to. In case of duplicates, duplicates should be removed and the respective extra column should show both sources: A B...
Leon Rai
1

votes
3

answer
1.5k

Views

Concatenating distinct column values to a string

I want to select distinct combinations of columns to a string. I do not know how to do it in a query. The scenario is as under c1 c2 c3 a 1 x b 2 x b 2 y I want a resultset like a:1:x a:1:y a:2:x a:2:y b:1:x b:1:y b:2:x b:2:y Any suggestions on how to do it?
Fawad Shah
1

votes
1

answer
387

Views

Wrong precedence when doing a string concatenation in php

The code is quite simple: echo 'RESP:'.$db->printList($pprofile); What db->printList($pprofile); does is that it prints some more string. I'm basically putting the string RESP before the value returned by db->printList($pprofile);. The problem is that the result is reversed. If db->printList($pprof...
hsnm
1

votes
1

answer
257

Views

Concatenating PHP strings from an iteration

I'm working on some Database functions and, for some reason, I made two functions to make simple inserts/selects with arrays passed as arguments to a php function. The problem starts here. // basic database functions, to aid the development :D static public function Insert($table, $items = array())...
Alexis Maiquez Murcia
1

votes
2

answer
750

Views

Can't add comma to sql text

Why doesn't this statement work? UPDATE users SET downloaded = downloaded + "4,"; It will only set downloaded equal to 4. downloaded is of type text. What am i doing wrong? I'm using mysql.
DarrenVortex
1

votes
3

answer
538

Views

r - how to use a variable in a variable

I have a data frame where the row names are words and I can call the first column of that row of data drame using something like >df['rowB',1] i know I can use paste to combine a variable and a string using paste to do something like >paste("the value is ", df['rowB',1], "."] and that will get me a...
user1714887
1

votes
1

answer
39.9k

Views

Concatenate multiple HTML text inputs with stored variable

I am trying to create a simple html form which asks for some details from a user and once this has been submitted will add the text to some predetermined text in a text box. Example of this... Text box 1 - Enter Name Text box 2 - Enter Age Text box 3 - Enter Location When this is submitted I would l...
drmscp
1

votes
1

answer
248

Views

Concatenate in Access 2000

I have searched 'concatenate' topics and have been unable to find the answer I need. This posting came close access sql query to concatenate rows but my attempts to make it work for my purpose failed. What I have is a table like this Lic# | Permit | Year ------------------------ 1 | NS1...
Andre831
1

votes
1

answer
270

Views

Using sub parametr in string with VBScript

I have a webpage that pulls a dynamic list of servers, and I want to be able to launch putty/winSCP with the select Linux boxes. I can't seem to pass parameters effectively. link Sub putty(hostIP) Set oShell = CreateObject("WScript.Shell") oShell.run """C:\Program Files (x86)\putty\putty.exe"" -ss...
Bolson32
1

votes
2

answer
532

Views

Concatenate css with php in link meta stylesheet

What is the way to concatenate multiple css files into one line with php? I want to reduce the following .. into the result one css or html file with all stylesheet inside This method reduce the http requests, and have other features for designer and developer with use dinamyc sites configurations.
Blackhero
1

votes
1

answer
605

Views

Insert string into array - PAWN script

I am trying to cut down my file lines by having one variable to insert into several arrays. So I'd like to have a string, or an array variable, such as the following: new combomeals[] = { 3025101, 3025100, 3003000, 3025002, 3030101, 3025001, 3025000, 3021602, 3031402, 3020100, 3031401, 3031400, 3...
brandoncluff
1

votes
2

answer
12.9k

Views

Concatenate Rows in Microsoft Access

The basic idea is that I have a table in this form in Access 2007: Company Name | Address | Product Company A 123 Fakestreet Phone Company A 123 Fakestreet Computer Company A 123 Fakestreet Car Company B 456 Fakestreet Football Company B 456 Fakestreet...
matt.jaffe
1

votes
1

answer
3.2k

Views

Crystal Reports / concatenating rows based on change in repeated field value

I have been pulling my hair out on this one. I'm not very adept at coding formulas. I have a two column database that looks like this: USERID1 1/1/2000 USERID1 2/1/2000 USERID1 3/3/2001 USERID2 1/5/2000 USERID2 2/7/2001 USERID2 3/30/2009 USERID2 3/10/2013 USERID3 2/5...
user2544132
1

votes
2

answer
212

Views

Mysql substring string and attach chars such as … to result command

My subject field is (maybe) bigger than 100 characters. I want to use LENGTH if subject length is bigger that 100 char in below mysql command and attach ... to end of SUBSTR subject. SELECT id , IF LENGTH(`subject`)
1

votes
1

answer
192

Views

Concatenate Massive Amount of Images with Similar Names

I have many, many pictures that I try to concatenate together. They all follow a similar naming convention. $Child_HF2_5.png $Child_HF2_5_ISO.png $Child_HF2_5_POSE.png $Child_HF2_6.png $Child_HF2_6_ISO.png $Child_HF2_6_POSE.png $Dwarf_TD_Female_3.png $Dwarf_TD_Female_3_ISO.png $Dwarf_TD_Female_3_P...
RainingChain
1

votes
1

answer
4.2k

Views

Define a variable by concatenating a string with a number in a loop of Stata

I am new to programming in Stata. My question is to run several pairs of regressions in a loop, like the following: reg outcome1 outcome2 covariates reg outcome2 outcome1 covariates I tried the following ways, but the first two came with the error "ambiguous abbreviation" and the second the error "t...
Randel
1

votes
1

answer
58

Views

Lotus Notes - concatenation in file line

I have a fileNum ( =FreeFile() ) in which I want to add the following line del -q name=java prog guide.pdf I tried : Print #fileNum%,{del -q name="}+askme+{"} Where askme is the ws.Prompt(PROMPT_OKCANCELEDITCOMBO,...) selection result. Prompt gives the possibility to choose some file names, as above...
Florin M.
1

votes
2

answer
619

Views

Calling php functions using concatenation - $newArticle->setInternationalText.$i();

I have eight php functions. They are: setInternationalText1() setInternationalText2() setInternationalText3() ...etc I want to call these functions all at once using minimal code. I have tried using a for loop but PHP doesnt seem to allow me to concatinate my 'counter' variable onto the end of a fu...
Bob Flemming
1

votes
2

answer
118

Views

create a paired value cell array from existing vectors

and have two vectors - a and b. a is of class double, and b is of class cell. I want to create a 2 x length(a) cell array that pairs the 1st value of a with the second value of b and so on.... I have so far for i=1:length(a) for j=1:length(ab c{j,i} = {a(j),cell2mat(b(i))}; end end where each output...
brucezepplin
1

votes
3

answer
179

Views

Concatenate a list with a list of lists

I need to extend a list with a variable number of lists as in the following example: a = [1, 2, 3] b = [4, 5] c = [6, 7, 8, 9] d = [b, c] The command I'm looking for should operate on a and d, and should give the following output: [[1, 2, 3], [4, 5], [6, 7, 8, 9]] that is the same as the output of:...
gaggio
1

votes
1

answer
3.7k

Views

Concatenating multiple files into one

Okay, so I want to concatenate multiple files into one. The problem is that the final file is empty. I want to know how I can write stuff into a file without overwriting and so on. Here's my code. Thanks in advance! void concatenate() { fstream fileToConcatenate, result; unsigned numberOfFiles = 0;...
user3105558
1

votes
2

answer
695

Views

How can I merge (concatenate) two columns in an array/matrix?

This is probably a pretty newb question, but…. In perl, I'm trying to read in a table (into an array) and combine the values of the first two columns. So for an input file with: 1 7 ABC DEF GHI 2 8 ABC DEF GHI 3 1 ZYX MNO PLQ I'd like to get out: 17...
Wolfgang
1

votes
1

answer
133

Views

concatenate indeterminate numbers of strings in SQL Server 2008

I need to send out an email in bulk, with the email containing each course associated with that particular user's email. The following query will return a list of all courses and users associated with them. select (cm.course_id + ': '+ cm.course_name) as course, u.lastname, u.firstname, u.email from...
Cliff
1

votes
2

answer
157

Views

Concatenating a complex string in VB. NET

I am using START-PROCESS to call MSTEST with multiple arguments that define the container and test settings, however I think it's choking on the way I'm concatenating this. Should I use some other method of constructing this string before putting it into START-PROCESS? Dim rwSettings As String = "\\...
Sean Long
1

votes
2

answer
62

Views

How can I concatenate words and integers in python?

I am trying to get the coordinates for something, in the form "[x,y]". For one line, all of the y-values are 5, and the x-values are 50, 55, 60, etc. I am trying to get python to print the coordinates. I've gotten everything but the printing part - for i in range(50,150): if (i%5 == 0): print '[' +...
user3342048
1

votes
5

answer
119

Views

How to create String from known elements of char array

I have a char array from string: public class CharIndexes { public static void main (String[] args) { String a = "A good example is the best sermon."; int len = a.length(); char[] tempA = new char[len] ; for (int i = 0; i < len; i++) { tempA[i] = a.charAt(i); } } I need to create 2 strings: a1 from...
1

votes
1

answer
6.4k

Views

sql concat columns from different tables

I'm looking to create a view that concatenates two columns from two tables together. the scenario is as follows: Table1 - Parent Id fname lname age Table2 – child Id parent_id fname age view – child Id firstlast age Given that the child table has a fk reference to parent’s ID, and parent has a...
downbySF
1

votes
2

answer
47

Views

Accessing the value of a concatenated variable name

Description of Problem: I'm attempting to streamline some code, except that I'm obviously just creating a string instead of accessing the value of the respective variable(s). How can I convert 'total_' + animal into a variable that I can then access to dynamically assign results to the DIVs? Code: J...
daveycroqet
1

votes
3

answer
4.1k

Views

getting a cell array of string into a matrix or table Matlab

I'm gathering information from calculations performed on some data and stored into arrays. I also have some info about these data coming from a text file which now and then contains strings. The strings from the text files got saved into a {} cell array of strings such as: strings={'s1' 's2' 's3'};...
Bastien

View additional questions