concatenation

Create a field name from a recordset

I have a form that displays information on a project that has 10 check boxes. The check boxes are named "chkAudience1", "chkAudience2", etc through "chkAudience10". Any combination of boxes can be checked from none to all and anything in between. Then I have a table that links the check boxes to the project. This table contains a field ...

date = date + part vs. date.concat(part)

I've got a small Java program that I'm developing for a project, which pulls a user's inbox from a specified URI using JavaMail, and then begins processing the messages. In Outlook, there's a function in the properties menu to set an expiry date for the message, which adds (for example): Expiry-Date: Thu, 14 Jan 2010 17:00:00 -0000 To...

What do curly braces mean in Verilog?

I am having a hard time understanding the following syntax in verilog: input [15:0] a; // 16-bit input output [31:0] result; // 32-bit output assign result = {{16{a[15]}}, {a[15:0]}}; I know the assign statement will wire something up to the result bus using wires and combinational logic, but what's up with the curly braces and 16{a[...

Most Pythonic way to concatenate strings

Given this harmless little list: >>> lst = ['o','s','s','a','m','a'] My goal is to pythonically concatenate the little devils using one of the following ways: A. plain ol' string function to get the job done, short, no imports >>> ''.join(lst) 'ossama' B. lambda, lambda, lambda >>> reduce(lambda x, y: x + y, lst) 'ossama' C. g...

Performing string concatenation from rows of data in a TSQL view (pivot?)

I'd like to create a view in SQL Server that combines several pieces of database metadata. One piece of metadata I want lives in the sys.syscomments table - the relevent columns are as follows: id colid text ---- ------ ------------- 1001 1 A comment. 1002 1 This is a lo 1002 2 ng comment. 1003 1 This is an e...

How to quote a quote with the CONCATENATE function in OOCalc

Hi All, In OOCalc I want to use the CONCATENATE function to add quotes to each string in column A. So in cell B1 I want to do: =CONCATENATE("\"",A1,"\"") OOCalc does not like this, or without the escaping backslash. Does anyone know how to do this, or what an alternative method might be? Thanks ...

How to make a sub string selection and concatenation in excel ?

Hello guys I have an excel file with field1 and field2 I want to take the first letter in field1 and concatenate it to field2 and put the result in field3 Example: Field1 = "John" Field2 = "Doe" I want to set the field three by some equation to be Field3 = "JDoe" ...

How to convert concatenated strings to wide-char with the C preprocessor?

I am working on a project where I have many constant strings formed by concatenation (numbers, etc.). For example, I have a LOCATION macro that formats __FILE__ and __LINE__ into a string that I can use to know where I am in the code, when printing messages or errors: #define _STR(x) # x #define STR(x) _STR(x) #define LOCATION _...

Include constant in string without concatenating

Is there a way in PHP to include a constant in a string without concatenating? ...

CONCAT for all results, or some kind of wrapper function for MySQL

This may be really easy but I'm wondering if there is a function in MySQL to have all results wrapped or appended without having to use CONCAT on each part? Something like: SELECT x, y, z WHERE 1 = 1 Where the results would normally be: x | y | z blah |stuff |junk big |small |huge good |bad |ugly Instead it returns...

Concatenate rows (sql server 2000)

I have the following problem when using SQL Server 2000 The following table has around 200 rows. Company / Employee 1005 / A 1005 / B 1005 / C 1010 / X 1010 / Y 1020 / L 1020 / M etc etc I wish to create the following (comma separated) output: Company / Employees 1005 / A, B, C 1010 / X, Y 1020 / L, M etc etc I'm having a really...

Concatenate values of n arrays in php

I have an unknown number of arrays, each containing an unknown number of words. I want to concatenate the values from each list so that all possible variations of the words are stored to a final array. For example, if array 1 contains: dog cat and array 2 contains: food tooth and array 3 contains: car bike I'd like the output t...

How can I end a string randomly and concate another string at the end in Python?

Basicaly I have a user inputted string like: "hi my name is bob" what I would like to do is have my program randomly pick a new ending of the string and end it with my specified ending. For example: "hi my name DUR." "hi mDUR." etc etc I'm kinda new to python so hopefully there's an easy solution to this hehe ...

SQL Query to concatenate strings or add default value

Hello, I have to create a View that shows a field created by concatenating some other fields. The simple query that I use is this one: SELECT CODPROY, DESCPROY, USER, CODPROY + ' - ' + USER + ' - ' + DESCPROY AS Expr FROM dbo.PROY The problem is that USER may be NULL and in this case I have to insert a default text, ...

Prepending to a string

What is the most efficient way to prepend to a C string, using as little memory as possible? I am trying to reconstruct the path to a file in a large directory tree. Here's an idea of what I was doing before: char temp[LENGTH], file[LENGTH]; file = some_file_name; while (some_condition) { parent_dir = some_calculation_that_yields...

LINQ: concatenate multiple int properties into a string

I have an object with two different integer properties in it, and I'm trying to get a a new object in Linq to Entities, combining two integer properties from the same object as concatenated strings, as follows List<DateRange> collection = (from d in context.dates select new DateRange { DateString = from s in context.Seasons wher...

Allocating memory for a char array to concatenate a known piece of text and an integer

I want to concatenate a piece of text, for example "The answer is " with a signed integer, to give the output "The number is 42". I know how long the piece of text is (14 characters) but I don't know how many characters the string representation of the number will be. I assume the worst case scenario, the largest signed 16-bit integer ...

MySQL concatenating fields but ignoring empty ones

I have a MySQL db with a list of people, including their address, which I want to return as one field in a query. It's split into address1, address2, address3, address4, post_code and I want to do something like the following SELECT CONCAT(`address1`, ' ', `address2`, ' ', `address3`, ' ', `address4`, ' ', `post_code`) AS `address` FRO...

mysql query normal relationship table vs concatenated realtionship table

I have a question about relationships between two tables. Let's say we have a table users, and links. users +++++++++ id name 1 name1 2 name2 3 name3 +++++++++ links +++++++++ id link 1 link1 2 link1 3 link1 +++++++++ Now the normal way to link these two is with a name_links table. For example: name_links ++++++++++++ uid ...

Perl: Encoding messed up after text concatenation

I have encountered a weird situation while updating/upgrading some legacy code. I have a variable which contains HTML. Before I can output it, it has to be filled with lots of data. In essence, I have the following: for my $line (@lines) { $output = loadstuff($line, $output); } Inside of loadstuff(), there is the following sub ...