Questions tagged [append]

To append is to join or add on to the end of something.

Append is an operation usually defined on 1D data structures (e.g., , , , , etc.).
The append operation adds an element to the end of the data structure, consequently, increasing its size by one.

11138 questions
27
votes
5 answers

How can I append the content of one map to another map?

I have the following two maps: map< string, list < string > > map1; map< string, list < string > > map2; I populated map1 with the following content: 1. kiran; c:\pf\kiran.mdf, c:\pf\kiran.ldf 2. test; c:\pf\test.mdf, c:\pf\test.mdf Then I copied…
Cute
  • 13,643
  • 36
  • 96
  • 112
26
votes
2 answers

df.append() is not appending to the DataFrame

I formulated this question about adding rows WITH index, but it is not yet clear to me how/why this happens when there are no indexes: columnsList=['A','B','C','D'] df8=pd.DataFrame(columns=columnsList) L=['value aa','value bb','value cc','value…
JFerro
  • 3,203
  • 7
  • 35
  • 88
26
votes
3 answers

Append an int to char*

How would you append an integer to a char* in c++?
user37875
  • 13,904
  • 9
  • 37
  • 43
26
votes
3 answers

Java. How to append text to top of file.txt

I need to add text to beggining of text file via Java. For example I have test.txt file with data: Peter John Alice I need to add(to top of file): Jennifer It should be: Jennifer Peter John Alice I have part of code, but It append data to end of…
user1816133
26
votes
4 answers

jQuery append text inside of an existing paragraph tag

I am trying to add additional text to the end of a paragraph using jQuery. My thought was to produce a structure like this: Judging by my answers I will clarify. I need to create this structure first. And this is the part that I find difficult, not…
sage88
  • 4,104
  • 4
  • 31
  • 41
26
votes
13 answers

Add / Change parameter of URL and redirect to the new URL

If the &view-all parameter does NOT exist in the URL I need to add it to the end of the URL along with a value. If it DOES exist then I need to be able to just change the value without creating a new URL because it might, or might not, have other…
Draven
  • 1,467
  • 2
  • 19
  • 47
25
votes
12 answers

Python append multiple files in given order to one big file

I have up to 8 seperate Python processes creating temp files in a shared folder. Then I'd like the controlling process to append all the temp files in a certain order into one big file. What's the quickest way of doing this at an os agnostic shell…
Martlark
  • 14,208
  • 13
  • 83
  • 99
25
votes
4 answers

How do I append some text at the end of a file using Ant?

In one of the configuration files for my project I need to append some text. I am looking for some options to do this using Ant. I have found one option - to find something and replace that text with the new text, and the old values. But it does not…
Vijay Shanker Dubey
  • 4,308
  • 6
  • 32
  • 49
25
votes
2 answers

Python concatenation vs append speed on lists

Taking this snippet from interactivepython.org: def test1(): # concat l = [] for i in range(1000): l = l + [i] def test2(): # append l = [] for i in range(1000): l.append(i) concat 6.54352807999…
user157000
  • 361
  • 1
  • 3
  • 7
25
votes
6 answers

How do you append an element to a list in place in Prolog?

If I have a list in Prolog such as X = [1, 2, 3, 4], how do I add the element 5 to the end of the list to have X = [1, 2, 3, 4, 5]? The append function needs two lists, ie append(A,B,C) to get A and B concatenated to the list C. I can do this…
No One in Particular
  • 2,846
  • 4
  • 27
  • 32
25
votes
4 answers

Does appending to a list in R result in copying?

Suppose I have create a list in R and append to it as follows: x = list(10) x[[2]] = 20 Is this equivalent to x = list(10) x = list(10, 20) ? I'm not so experienced with the particular details of how R handles lists in memory, but my limited…
guy
  • 428
  • 4
  • 16
24
votes
3 answers

Add line breaks or spaces between elements when using jQuery .append()

I have a jQuery set of elements that I get from my DOM by calling: $(".some-selector"); All my elements are DIVs each in its own line. My DIVs are set CSS (among other things) display: inline-block; which prevents them from rendering as block…
Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
24
votes
3 answers

Shapefile into geojson conversion python 3

output_buffer = [] for features in range(0,layer.GetFeatureCount()): feat = layer.GetNextFeature() geom = feat.GetGeometryRef() result = feat.ExportToJson() output_buffer.append(result) When I convert into geojson, I get output, but…
Vas
  • 395
  • 1
  • 3
  • 13
24
votes
2 answers

How to appendReplacement on a Matcher group instead of the whole pattern?

I am using a while(matcher.find()) to loop through all of the matches of a Pattern. For each instance or match of that pattern it finds, I want to replace matcher.group(3) with some new text. This text will be different for each one so I am using…
cottonBallPaws
  • 21,220
  • 37
  • 123
  • 171
24
votes
3 answers

Jquery: Click event doesn't work after append. (Don't know how to use .ON)

I have 2 click events. One appends an IMG which includes another click event. It doesn't work obviously. I know that I have to use jQuery's .ON, but I just can't figure out how and where. My code: $( document ).ready(function() { // The one…
user2669261
  • 396
  • 1
  • 5
  • 18