Group, I can't seem to append multiple files into one text file. Unfortunately it's creating the first file but is not creating or appending the additional files into the first file. My code looks like this: getRestranName = System.IO.Directory.GetFiles(folderName) Dim counter As Integer = My.Computer.FileSystem.GetFiles(folderName).Count fileCount = Convert.ToInt32(counter) fileCount = fileCount - 1 hotelFolder = CStr(getFolderNameGD("O:\Revenue Management\Centralized Revenue Management Service\CRMS Hotels", propertyNo2 & "*")) ' Begin by setting the loop to read each file in folder For i = 0 To fileCount fileName = "" Dim objReader1 As New System.IO.StreamReader(getRestranName(i)) fileName = getRestranName(i) If System.IO.File.Exists(fileName) Then Do While objReader1.Peek() <> …

Member Avatar
Member Avatar
+0 forum 8

Hi I am fairly new at pyhton and I am trying to create a program to append a new row of raw input to the bottom of my existing .csv file. So far I have this: [CODE]import csv x=1 y=1 n=0 citiesx=[] citiesy=[] city_names=[] total=input("How many cities do you have? ") while x in range(0,total+1): city_name=raw_input("What is the name of your city?<'0' exits> ") if city_name==0: break else: xcoord=input("What is the x coordinate?<'0' exits> ") if xcoord==0: break else: ycoord=input("What is the y coordinate?<'0' exits> ") if xcoord==0: break else: city_names.append(city_name) citiesx.append(xcoord) citiesy.append(ycoord) x+=1 w = csv.writer(open('cities.csv','w')) spamWriter = csv.writer(open('cities.csv', …

Member Avatar
Member Avatar
+0 forum 4

hi. i got 2 tables next to each other: .contact-names & .guest-list and a left and a right button between those tables and a drop down list. by default both tables have the message "Please select an event" from the drop down. when an event is selected .contact-names will be filled with names from database which was hidden by default while .guest-list is empty. when a 3 rows(names) from .contact-names is selected background for those rows change to red. and then when right button is clicked those three names get appended to .guest-list(class for guest-names tbody). the problem arises when …

Member Avatar
Member Avatar
+0 forum 2

hey guys. js: $(".addGuest-btn").live("click", function(){ /*in table2*/ var addG = $(this).parent(); var insert = '<tr><td class="insertG"><input type="text" class="add-name" placeholder="Doubleclick on a name."></td></tr>'; $(addG).append(insert);/*append into table2*/ }); }); $(".guests td").dblclick(function(){ /*table1 td*/ alert("double clicked!"); var name = $(this).clone(); $(".add-name").each(function(){ if($(this).val() == "") { $(this).append(name); } }); addGuest function works and appends the text box. the other half of the code doesn't run. the alert for double click appears then the rest of the function doesn't run. i tried changing $(this).append(name) to $(this).val(name); /*and*/ $(this).append().val(name); but got [object Object] in the text box. TIA

Member Avatar
Member Avatar
+0 forum 3

hey guys. so i was thinking of creating this page that has 2 different tables : table1(table1 filled with names that are populated from database but lets not think about that part for now) and table2(empty), table1 rows are clickable and when doubleclick on one row the data in that row appends to table2 row but i would like that to also work on table2(moves from table2 to table1). obviously there are other functions that i would like these 2 tables to do but in order to do that i need to figure out the doubleclick functions. I am also …

Member Avatar
Member Avatar
+0 forum 2

I have this code:: name_list=[] name1=print(input("what is your name: ")) name_list.append(name1) print(name_list) it returns Jon [NONE] If i input a name jon. Why does it not append to list please?

Member Avatar
Member Avatar
+0 forum 2

I am trying to add a comma to the end of each line ('\n') of a text file til the end of the file is reached. I am opening the file in append mode but am unsure as to how to go about identifying when the end of line is reached and how to add the comma (perhaps replace the newline char with the comma). Any suggestions?

Member Avatar
Member Avatar
+0 forum 3

Hello, Has anyone ever repeatedly wrote to the same text file, using the append mode, and when examining the text file, several lines were missing? Here are the specifics to my code: 1. Each line in the output, the text file, contains data from one experimental session (e.g. the session time, experimenter name, session #, a series of responses to variables being tested) 2. When I first write to the text file, I create a string variable that starts with "\n". Here's an example of the code: sessioninfo = "\n" + "," + string_variables + "," fp=open("data.txt", "a") fp.write(sessioninfo) fp.close() …

Member Avatar
Member Avatar
+0 forum 3

Hi, I've just started out with Python and I've been stuck on this problem for a few hours now trying to parse a file into a certain format.. I am trying to create a list in a list out of a list. I currently have this list; ['MPNRRRCKLSTAISTVATLAIASPCAYFLVYEPTASAKPAAKHYEFKQAASIADLPGEVLDAISQGLSQFGINL', 'MQLVDRVRGAVTGMSRRLVVGAVGAALVSGLVGAVGGTATAGAFSRPGLPVEYLQVPSPSMGRSELPGWLQA', 'etc'] What I am trying to make is a list of each item, with the first 40 individual characters in the strings as items, while translating them into an int for example; M = 1.43, P=1.53, I want to be able to have each item as an individual list before putting …

Member Avatar
Member Avatar
+0 forum 2

Hi again! So, I have an object that gets appended to a linked list now. Now I need to have all of that item's data output in a formatted manner - something similar to this: CD Artist CD Title CD Length Track Name Track Length Arist name here Title here hh:mm:ss Track name here mm:ss Track name here mm:ss Track name here mm:ss The problem with this is that the output for this is all in the overloaded << operator for my CD object and I'm having trouble figuring out how to append the track names and track lenghts, which …

Member Avatar
Member Avatar
+0 forum 6

Basically, I'm getting an error when I try to append a CD object to my linked list. What error? This one: > First-chance exception at 0x550257aa (msvcr100d.dll) in Programming 3 Course Project.exe: 0xC0000005: Access violation reading location 0xfeeefee2. > Unhandled exception at 0x550257aa (msvcr100d.dll) in Programming 3 Course Project.exe: 0xC0000005: Access violation reading location 0xfeeefee2. My code to append: case 1: tempCD.defineCD(); cout << "Works" << endl; CDlist.appendNode(tempCD); cout << "Still works." << endl; break; My linked list's appendNode function code: //Append List**************************** //*************************************** template <class T> void TList<T>::appendNode(T newValue) { ListNode<T> *newNode; ListNode<T> *nodePtr; //Make a new node, store …

Member Avatar
Member Avatar
+0 forum 15

Not sure if I am in the right section for this. I am currently designing a web page using javascript, html and css. The page is a seat booking seat which allows the user to select and unselect seats. I have managed to get the page to display id of the seat when the user have selected a seat, but I am having problems trying to remove id from the display if user unselects the seat. Below is the javascript code $('.available, .unavailable, .selected').click(function(){ var ID = $(this).attr('class'); if (ID == 'n unavailable' || ID == 'p unavailable') { alert …

Member Avatar
Member Avatar
+0 forum 3

Hi, I'm learning python and I just started to learn about classes. To get a handle on this, I decided to make a black jack game and create 3 classes: deck, hand, and card. I created a card class, but I am not sure how I would implement it in the hand class when I create those methods. For example, did I do the add_card method correctly for the hand class? How does python know that card must be of class Card? Thank you! SUITS = ('C', 'S', 'H', 'D') RANKS = ('A', '2', '3', '4', '5', '6', '7', '8', …

Member Avatar
Member Avatar
+0 forum 3

Ideally my program should work like this... Upon button click a random message (out of 3 messages) is appended to a text area(or pane, etc). One message should display blue, one green and one red. Currently I am using JTextPane. I have figured out how to append text easily but I cannot get it to show up in the designated color. When using html tags, it doesn't append at all. When I change the foreground color of the text, all of the text changes to one color. Which would best method to use for what I am trying to do, …

Member Avatar
Member Avatar
+0 forum 3

Hello! I am currently attempting to read all the lines from a text file, and append them to one long string. At the moment, it seems that the line that is read in keeps overriding the string, instead of appending it. I think it has something to do with the newline character within the textfile, but I'm not 100% sure how that is affecting it. Just wondering how I would append the strings to one long one. Any help would be appreciated, Thanks! int main(){ string line, fullLine; ifstream in("data.txt"); if(!in){ cerr << "Unable to open file" << endl; return …

Member Avatar
Member Avatar
+0 forum 2

Can I append a list obtained from a Class as output outside the class , if Yes how ?? can i use userList for this purpose ?

Member Avatar
Member Avatar
+0 forum 4

#include <stdio.h> #include <malloc.h> struct node { int data; struct node *link; }; void append (int data, struct node **s) { struct node *p, *q; if (*s == NULL) { p = (struct node *) malloc (sizeof (struct node)); p->data = data; p->link = NULL; *s = p; return; } q = *s; p = (*s)->link; while (p != NULL) { q = p; p = p->link; } q->link = (struct node *) malloc (sizeof (struct node)); q->link->data = data; q->link->link = NULL; return; } void insertion_sort (struct node *s) { int i, j; struct node *temp = s, *r; …

Member Avatar
Member Avatar
+0 forum 4

Even though it's incredibly bad practice, most advertising servers still use document.write. It's terrible because placing `<script type="text/javascript" src="http://www.ad-server.com/foo.js" />` where you want the ads to appear is page blocking. I'm trying to move the script tag to the very bottom of the page (so at least everything above it loads), but then I need a way to have everything it outputs written to a specific place (preferably with jQuery selectors). Basically what I currently have to work with is a dynamic third-party ad tag that was the result of an ad server call, saved as a string. Sometimes the …

Member Avatar
Member Avatar
+0 forum 22

Hi All, I am newbie to XML. I want to create only one XML file each day automatically using php function with the following format. I want to use the same function for appending the follwing portion into the existing XML file ## This portion need to append whenever the function is being called ## <Call> <StartTime>2012-07-12T01:13:01-00:00</StartTime> <User>adam</User> <Action>UI</Action> <Duration>0</Duration> <Application>Web apps</Application> <Interface>HTML (UI)</Interface> <Host>www.xyz.com</Host> </Call> #XML FILE FORMAT # <Monitor xsi:schemaLocation="http://xml.xyz.com/monitor/namespace http://xml.xyz.com/monitor/xsd/Monitor.xsd" xmlns="http://xml.xyz.com/monitor/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Call> <StartTime>2012-07-12T01:13:01-00:00</StartTime> <User>adam</User> <Action>UI</Action> <Duration>0</Duration> <Application>Web apps</Application> <Interface>HTML (UI)</Interface> <Host>www.xyz.com</Host> </Call> <Call> <StartTime>2012-07-12T01:13:01-00:00</StartTime> <User>john</User> <Action>UI</Action> <Duration>0</Duration> <Application>Web apps</Application> <Interface>HTML (UI)</Interface> <Host>www.xyz.com</Host> </Call> ## need to …

Member Avatar
Member Avatar
+0 forum 1

Hi all - I have the following variable in my code $url=urlencode(''.$token.''); How can I add &app_data=any_string_here to the above variable, everytime I add it, I get an error saying unexpected

Member Avatar
Member Avatar
+0 forum 1

Hi, I'm creating a bookmarks system for my web browser. I'm learning how to use XML files with VB.Net, so my bookmarks are stored in an XML file. When I want to add a new bookmark, the code below works, but it only allows for one bookmark. How can I append to the XML file instead of overwriting it? 'It's not bookmarked, so let's add it Dim wtrXML As New XmlTextWriter(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\Test" & "\" & "Bookmarks.xml", System.Text.Encoding.UTF8) With wtrXML .Formatting = Formatting.Indented .WriteStartDocument() .WriteStartElement("WebSites") .WriteStartElement("WebSite") .WriteElementString("Name", browser.Title) .WriteElementString("URL", tbaddress.Text) .WriteEndElement() .WriteEndElement() .WriteEndDocument() .Flush() .Close() End With Thanks for your …

Member Avatar
Member Avatar
+0 forum 2

void doc::add_title() { doc d; fstream f; int med_lic,flag=0; char new_title[20]; cout<<"\n\t\t\tADD NEW DOCTOR TITLE\n"; cout<<"\nEnter the Doctor's medical license number :\t"; cin>>med_lic; f.open("doctors.da t", ios::binary|ios::in|ios::out); while(f.read((char*)&d,sizeof(doc))&&flag==0) { if(d.ret_med_no()==med_lic) //d is an object of class doc { cout<<"\nEnter the new title:\t";//ret_med_no() is an accessor function used to return a value used to find a record. gets(new_title); strcat(title,new_title);//title is a private member of class doc.new title is to be added next to this one. int pos=(-1)*sizeof(doc); f.seekp(pos,ios::cur); f.write((char*)&d,sizeof(doc)); flag=1; } else f.write((char*)&d,sizeof(doc)); f.close(); if(flag==0) cout<<"\nRecord not found.\n"; } } # The concept # This function is a part of the program …

Member Avatar
Member Avatar
+0 forum 1

[CODE] Dim wri As New IO.StreamWriter("e:\test.txt", True) wri.WriteLine(ListBox1.SelectedItem, true) wri.Close())[/CODE] etc in llistbox1 items , "1" "f1" "f2" when i click for example f1 that code will save it and when i want you save the same item it wit will save it in other line and in test.text file looks like this f1 f1 f1 f1 f1 i don't want that i want to only save once ,not repeatedly save that item in each line thanks for helping me :)

Member Avatar
Member Avatar
+0 forum 8

I did something like this: [CODE]$('#test').append("<option id='ddm'>added dropdown</option>");[/CODE] it shows its html in the browser but I can't see it when I view source, is this normal? Thanks.

Member Avatar
Member Avatar
+0 forum 1

The exercise says the following: """ Pairwise comparision of DNA sequences is a popular technique used in Bioinformatics. It usually involves some scoring scheme to express the degree of similarity. Write a function that compares two DNA sequences based on the following scoring scheme: +1 for a match, +3 for each consecutive match and -1 for each mismatch. Examples [CODE] >>> print pairwiseScore("ATTCGT", "ATCTAT") ATTCGT || | ATCTAT Score: 2 >>> print pairwiseScore("GATAAATCTGGTCT", "CATTCATCATGCAA") GATAAATCTGGTCT || ||| | CATTCATCATGCAA Score: 4 >>> [/CODE] """ so i wrote the following, which was continuously working until i started playing with it, now …

Member Avatar
Member Avatar
+0 forum 9

Hi all, this is a homework assignment that I'm not sure how to begin with. We are given all the code and I just need to finish a function to convert digits to words. For example, the string "1, 2, and 3." becomes "One, Two, and Three." The String "10" becomes "OneZero." We aren't allowed to use any loop constructs either ("for" or "while"). We are supposed to use the switch-case statements somehow. The missing function is the "public void append(char c)" This is what I have but I'm getting no results. [CODE]public abstract class Builder { // Appends just …

Member Avatar
Member Avatar
+0 forum 10

Create a function generateNumbers(num) that takes in a positive number as argument and returns a list of number from 0 to that number inclusive. Note: The function range(5) will return a list of number [0, 1, 2, 3, 4]. Examples [CODE] >>> generateNumber(1) [0, 1] >>> generateNumber(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> generateNumber(0) [0] [/CODE] i dont know how to do this. i tried; [CODE] def num(num): for x in range(num): lis = [] lis.append(x) y = x + 1 lis.append(y) return lis [/CODE] but it return the following; [CODE] num(10) [0, 1] …

Member Avatar
Member Avatar
+0 forum 5

Before I really dig in ----- HAPPY NEW YEAR EVERYONE! A few of you may remember that I have been working on producing a large wood knowledge base (woodsoftheworld.org). It is totally none profit. I am getting much closer to having enough working that soon I hope to be able to declare it at version 1 stage. I have a large respect on how powerful SQL can be but I still have difficulties to get my statements right, undoubtedly syntax errors. Hope someone can help with something a few may look at as elementary. This year I want to get …

Member Avatar
Member Avatar
+1 forum 11

Hi all! I am developing a java-game where you are building with balls. It will connect to a server to create a huge map available for everybody playing this game.:) For this, I need a PHP-file who will append some urldata into the file data.txt, for adding a ball into the server map. But when I run this file for testing, something very stranged happend. I can't explain it, but I must fix it if i want to be done with my game.:S the PHP file is called addball.php and the url goes like this: [url]http://localhost/ballania/addball.php?ball=11x10x1x0x0[/url] the data I want …

Member Avatar
+0 forum 0

I want to build a script that does the following: The script should do make an arry from the directory where the script is with os.listdir(). Then the script has to test if the value in the array already excists in the outcome file, if not the name in the array should be written to the file alphabetically. For example: array=['test123','hallo','ABC','zipcode','myname','computer','test456'] The outcome in my file should be: ABC computer hallo myname test123 test456 zipcode Could anyone please help me to make a script like this? I already started making this: But the problem with this is. That everything is …

Member Avatar
Member Avatar
+0 forum 2

The End.