Questions tagged [concatenation]

Joining of two or more sequences into a single sequence.

Concatenation refers to the joining of two or more elements into a single element.

In programming, this can refer to

  • concatenation, which joins multiple strings into a single string
  • concatenation, where one or more arrays are combined (mostly appended) to make a new array
  • specific concatenation functions that combine elements along a specified dimension (horizontally, or vertically for example), replicate and tile existing elements, and so forth.
12037 questions
3
votes
3 answers

Return all the distinct values of column B in one row for each distinct value in column A

Take the following table: CREATE TABLE boxes ( box integer, color character varying, size integer, ... ); where both box and color can assume not unique values out of a small set. Querying this table with: SELECT color, box FROM…
Claudio Floreani
  • 2,441
  • 28
  • 34
3
votes
3 answers

Oracle DB query formatting

I have a problem with formatting the data when doing an query to an Oracle database. What I want to do is to export some data into the formatbelow into a textfile; 1IN20071001 40005601054910101200 1 65 First number (1 above)…
Petter
3
votes
2 answers

Concatenate mail subject in PHP mailer

I have a form for users to submit their inquiry which will be sent as an email. As users are able to select their inquiry type, i wish to concatenate the inquiry type into the subject of the email. $formname = "Website Inquiry Form"; $inquirytype =…
Spiral1ng
  • 313
  • 1
  • 7
  • 16
3
votes
1 answer

Is there some way in Linux to create a "virtual file" that is the concatenation of two files?

I have two data sets that I want to run a program on. I want to compare the results to running the analysis on each set individually, and on the combined data. Since they're large files, I'd prefer not to create a whole new file that's the two data…
Colin
  • 10,447
  • 11
  • 46
  • 54
3
votes
1 answer

Adding _concat to numbers to create number ranges - am I mad?

Just as a random experiment I'm considering adding a __concat() metamethod to the number metatable (usually a new metatable as numbers don't seem to have metatables by default?). The idea is that I could do something like 3..5 and get back 3, 4,…
cabbageforall
  • 620
  • 1
  • 5
  • 12
3
votes
4 answers

How to Concatenate Two LPCSTRs

I have two LPCSTRs I need to concatenate like so: if (!rename(directory + originalFileName, directory + fileName)){ std::cout<
3
votes
1 answer

"Variable" variable names c++

The Problem: I've been searching on here for a while looking for a way to loop through variables named somewhat like variable_1, variable_2, ...., variable_n. Basically, I'm asking if there's a way to do that using a loop to achieve variable_i or,…
ThunderStruct
  • 1,504
  • 6
  • 23
  • 32
3
votes
3 answers

Why string concatenation takes so long time?

I am concatenating a String in a loop but it takes ages, why is that? for (String object : jsonData) { counter++; finalJsonDataStr += object; } Variable object is a piece of JSON, up to 70 chars and the loop goes approx 50k times. I…
Ondrej Tokar
  • 4,898
  • 8
  • 53
  • 103
3
votes
3 answers

Concatenate elements of two string arrays jQuery

I have two arrays of strings called old_array and new_array, and I want to concatenate them together like thus: old_array = "fd.com/product1/,fd.com/product2/,fd.com/product3/" new_array = "image1.jpg,image2.jpg,image3.jpg" (code happens in this…
The831st
  • 43
  • 4
3
votes
2 answers

How to concat the mp3 file and webm file into a new webm file?

There is a webm file that contains no audio. I want to merge an audio file with this video. I've tried the following command: ffmpeg -i /home/test.mp3 -i /home/output.webm -vcodec copy -acodec copy /home/newtest.webm And received the error: Could…
showkey
  • 482
  • 42
  • 140
  • 295
3
votes
5 answers

C preprocessor - token pasting - confusing result. Why is that?

I thought this program would print the value -12--2=-10. When I run it, it prints 0. I cannot figure out why? Any hints? #include #define ALPHA(x,y) x##2-y int main(void) { int i = -1; int i2 = -2; printf("%d",…
Ely
  • 10,860
  • 4
  • 43
  • 64
3
votes
2 answers

Concatenate two string arrays without using STL or vectors in C++

I'm teaching myself C++ hence the awful naming and super simple question. I'm trying to concatenate two arrays in C++. The array are of type string. Their constructor allows for them to have a default capacity of 12. So basically I'm trying to…
KFDoom
  • 772
  • 1
  • 6
  • 19
3
votes
1 answer

Get SQL Server's constraints list without redundancy

With this query I get the list of all my database's CHECK, FOREIGN_KEY, PRIMARY_KEY and UNIQUE_KEY constraints. SELECT o.object_id as ID, o.name AS Name, OBJECT_NAME(o.parent_object_id) AS TableName, o.type_desc AS TypeName, …
J.P.A
  • 95
  • 6
3
votes
4 answers

Yii2 Gridview merge two columns

i have a gridview in Yii2 with two columns, first_name and last_name. I want to merge this two values into one single column named full_name made like tihs: 'first_name'.' '.'last_name' , searchable and filterable. How can i do it?
piebuo
  • 141
  • 1
  • 2
  • 7
3
votes
3 answers

MYSQL - Combine rows with multiple duplicate values and delete duplicates afterwards

So I have my database set up as a single table. In that table I have collected source URL and description (I am scraping the product description from a number of pages). Unfortunately I have ended up with multiple rows in the database for a…
Daniel Lee
  • 367
  • 5
  • 20