Hello Daniweb Community, I was wondering if there is a way to replace words from a listbox. So at the moment I've got a listbox with a couple of strings to be replaced in the textbox, however single line listbox items work but when I add a multi-lined item eg. Hello There It'll go into the listbox as HelloThere, so when I go to use the for each to replace them It doesn't work. I've tried manually replacing it by using `TextBox1.Text = TextBox1.Text.Replace("Hello" & Environment.NewLine & "There")` it'll work, and if I try For Each lbItem In .ListBox1.Items TextBox1.Text …

Member Avatar
Member Avatar
+0 forum 3

i've stored a line into string `$output='01/07/201521/08/201691754.0';` i want split the line as three different words & store into variables var1 var2 and var3. eg: var1=01/07/2015 var2=21/08/2016 var3=91754.0 hope someone will fix this issue.

Member Avatar
Member Avatar
+0 forum 8

Dim temp As Translator Using sr As IO.StreamReader = New IO.StreamReader("text.dll") For i As Integer = 0 To 15 trans(i).english = sr.ReadLine trans(i).arabic = sr.ReadLine Next For i As Integer = 1 To 15 For j As Integer = 1 To 16 - i If trans(j - 1).english > trans(j).english Then temp = trans(j - 1) trans(j - 1) = trans(j) trans(j) = temp End If Next Next Do While (True) Dim line As String = sr.ReadLine If line Is Nothing Then Exit Do End If Dim words As String() = line.Split("|") Dim word As String For Each word In …

Member Avatar
Member Avatar
+0 forum 12

please i need help with my work.. write a program in c++ that accepts a real number with two decimal places and output the vallue in words.. [assume that no amount will exceed 999999999999.99

Member Avatar
Member Avatar
+0 forum 4

Hello i have a little problem with writing the words in the database, after some space between the words the database can't remember it, thats why because the link eg. ( /some_file.php?search=something%20wierd ) that "%20" its the space between the words but from my mobile application when ill type space doesnt write it into the database... what should i do ? :/ Also i want to give message "You are not connected to the Internet" if is true... public static String sendSearch(String search) throws Exception { URL url = new URL("http://secretchatsk.host56.com/some_file.php?search="+search); URLConnection conn = url.openConnection(); InputStream stream = new BufferedInputStream(conn.getInputStream()); …

Member Avatar
Member Avatar
+0 forum 18

A simple way to find duplicate words in a text. In this case the text is preprocessed to eliminate punctuation marks and set all words to lower case.

Member Avatar
Member Avatar
+2 forum 1

I'm just trying to figure out how to get everything after the first two words in a line. Right now, I've got the opposite - the first two words themself: ^(\S+ \S+) I want the opposite of this. Thanks!

Member Avatar
Member Avatar
+0 forum 2

I saw that github commands in linux terminal always uses word "git" before all it's commands. How to use my own word for my shell script? for example, $ git commit or $ git status

Member Avatar
Member Avatar
+0 forum 1

#include <stdio.h> #include <stdlib.h> int main() { char word[50]; int wordLength, i, reverseCount; reverseCount = 0; system( " color F5 " ); printf( "\n How many letters does the word have? : " ); scanf( "%i", &wordLength ); printf( " \n Enter word, letter by letter " ); for( i = 0; i <= wordLength; i++ ); { scanf( "%c", &word[i] ); } while( reverseCount != 0 ) { for( reverseCount = i - 1; reverseCount != 0; reverseCount-- && i++ ) { i = 0; if( word[i] != word[reverseCount] ) { printf( " \n Word is not a palindrome. …

Member Avatar
Member Avatar
+0 forum 2

I have to write a program that takes a word from the user and replaces it if it is in the text file with another word given by the user. Then takes that input and writes it to a new file. The only problem is, I have to do it without using the built in replace() string function. What I have so far: input_data = open('input.txt','r') output_data = open('output.txt','w') x = input('Enter the word to be replaced:') y = input('What should I replace all occururrences of ', x, 'with?') for line in input_data.split(): for word in line: if word in …

Member Avatar
Member Avatar
+0 forum 7

Hello, please would anybody know if there's any game software where I could include words and sentences? Although I'm still new in this area, I'm very interested in creating some games for teaching purposes. Thanks and Regards, Silvia

Member Avatar
Member Avatar
+0 forum 3

I have a special problem over in terms of sorting out those words like a keyboard type. For example: the user inputs these words into the textarea HOUSE DOLL KITE NICE Then, the result should be DOLL HOUSE KITE NICE this is sorted out according to the qwerty order. <?php $words = array(); $order=array('q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m'); $qwerty_words = array(); if(isset($_POST['submit'])){ $text = $_POST['texts']; $text = "one two free"; $separate_of_texts = explode(" ",$text); //$words = array($separate_of_texts); $count_words = count($separate_of_texts); $count_order = count($order); //storing array values for($i= 0; $i<$count_words;$i++){ $words[$i]=$separate_of_texts[$i]; } for($i=0;$i<$count_words;$i++){ $temp = array(); $sep_letters=explode(' ',$words[$i]); if(!in_array($sep_letters[$i], $order)){ } } foreach($qwerty_words as $values){ …

Member Avatar
Member Avatar
+0 forum 10

When i run a single number (1-9), it'll output as ONEONE or TWOTWO, etc.. As well with numbers 11-19, they'll show up as ONEELEVEN or TWOTWELVE, etc. 20-100 outputs fine whereas 101 becomes ONE HUNDRED TEN ONE ONE, etc.I have no idea what I've done any help would be greatly appreciated. public class Main { public static void main (String args []) throws IOException { //Initializes the BufferReader for user input BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); System.out.println("Numbers to Words (1-999 Edition)"); System.out.println("================================"); int tryAgain=1;//will initiate the first do-while loop of the program. do{ System.out.println(); System.out.println("Input a number …

Member Avatar
Member Avatar
+0 forum 2

Is it possibile to display moving words in cobol?similar to tertris?thanks

Member Avatar
+0 forum 0

I would be great if someone could spot the problem with this code please. I have a MySQL table that was populates an Options list which works well when adding new records to another database table. The code is: $query="SELECT id, types FROM $table ORDER BY types ASC"; $result = mysql_query ($query); echo "<select name=\"type\">"; echo "<option value='Select from list.....'>Select from list.....</option>"; while($nt=mysql_fetch_array($result)){ echo "<option value=$nt[types]>$nt[types]</option>"; } echo "</select>"; In an EDIT program I required the Options list item previously selected when adding the record to be 'echo'd back'. I changed the above code to do this as shown here …

Member Avatar
Member Avatar
+0 forum 5

i have a db with 3 tables review, pos and neg words for a film review im trying to detect if the word 'not' appears before a positive or negative word then add 1 to the pos count if it appears before a neg word ie this was not bad, and add 1 to the neg count if it appears before a pos word i.e this was not good currently i have this method but it only seems to detect the not before a word once, how can i get it to detect through the whole text for example if …

Member Avatar
Member Avatar
+0 forum 16

Hi! I'm new to C and I'm having some problems in my program. It opens a .txt file then copies this to another .txt file but replaces a certain word with another word. It uses command line arguments. Example: //inside text.txt love is patient love is kind ... ./change love MONEY text.txt text_new.txt Output: //generates a .txt file <text_new.txt>. inside is MONEY is patient MONEY is kind ... I'm having problems replacing the words. We're asked to use strtok(). Here is my code [CODE] #include<stdio.h> #include<string.h> int main(int argc, char *argv[]) { FILE *oldfile; FILE *newfile; unsigned int i=0; char …

Member Avatar
Member Avatar
+0 forum 1

I am trying to write a function that compares two text files (test1.txt and test2.txt) word by word, the function is supposed to print "files are equal", "files differ: word %d" (if word 13 then past 12 words were equal), and "EOF on [filename]" (the files were equal word by word but one of the files ended before the other). The problems I am having are: [LIST] [*]the EOF statement only prints if one of the files are completely empty [*]the files differ statement only occurs if the first word is different, otherwise it won't print the statement [*]the files …

Member Avatar
Member Avatar
+0 forum 4

Hi all, How i can split a sentences into words and add splitted words into listbox. Thank you. Best regards Eko

Member Avatar
Member Avatar
+0 forum 4

Hi! I am working on a program to count the number of characters and words in a text file. The counting characters portion works, but my countWords function displays '0'. I built the countWords function on the basis of my countChar function, but since it's returning zero I'm not sure whether there's something still stored in the input stream that I need to clear, or maybe I'm not passing the correct information? I realize that after I get a number, I may need to do some +1 or -1 to bridge the relationship between spaces counted and words. Any hint …

Member Avatar
Member Avatar
+0 forum 2

In file i have a text. Words form line to line dont raising. Word in line separate least one space.Spaces can be at line begining and ending, can be empty lines. Count how many words can be in real number. i need a function whitch can count words whitch can be real number. I started like that this was first task, and now i need to count words, please help me ;/ [CODE]const char Cduom[] = "Duomenys.txt"; const char Crez[] = "Rezultatai.txt"; const char Canalize[] = "Analize.txt"; #include <string> #include <fstream> #include <iomanip> using namespace std; void ApdorotiTeksta(const char dfv[], …

Member Avatar
Member Avatar
+0 forum 3

Guys, I'm actually almost done. Basically what I have to do is to read from file with a list of words, sort them alphabetically and write them into another file. I am almost done, but the only thing is, the assignment says that we shouldn't change the case of words, but I am changing everything to lowercase, because I'm using arrays to compare letters. So how can I keep the case? Or change everything to lowercase and then change the originals back after sorting, while writing? [code] #include<fstream> #include<iostream> #include<string> #include<cstdlib> using namespace std; int main() { ifstream inFile, inSortFile; …

Member Avatar
Member Avatar
+0 forum 10

Hello, i was wondering how would i make a search kind of thing, for example if string1 contains all the words in string2 words. like a search(not just if string1 contains string 2). it should work something like this: If string1 is "an apple" and if string2 is "djsjfsfg apple sdfsfssdfs" then string3 would be nothing BUT If string1 is "an apple" and if string2 is "djsjfsfg apple sdfsfssdfs an ashdfjdsgfsdgfj" then string3 would be "djsjfsfg apple sdfsfssdfs an ashdfjdsgfsdgfj"

Member Avatar
Member Avatar
+0 forum 5

So this is my first post and I have only begun using python. One of my first assignments is to design a program which will count the most used words in the given text file. In my case we are using the Declaration of Independence. Here is what i have so far, I think everything is fine up until the end were i get confused.The Problems i seem to have is with the My dictionary statements at the bottom. Any way to sort it out? Once again i'm sorry if i sound terrible but I've only just started this so …

Member Avatar
Member Avatar
+0 forum 6

I am trying to get consecutive words in a document using flex. Normally the forward slash should work, but for some reason it is not. Also I need to account for spaces. So I can't seem to use that regex character for this, how do I account for consecutive words in flex C++ programming.

Member Avatar
+0 forum 0

I am trying to create a program that, after inputing a text file, can: 1) Count number of lines in the text file. 2) Count number of words in the file. 3) Count number of characters in the file [B][U]including[/U][/B] white spaces. 4) Count number of characters in the file [B][U]excluding[/U][/B] white spaces. I have written the following code: [CODE]#include <iostream> #include <string> #include <fstream> using namespace std; int main() { ifstream file("wordcount.txt"); string s1; int words=0, lines=0, ch_spaces=0, ch_nspaces=0; while (!file.eof()) { getline(file, s1); ch_spaces += s1.size(); lines++; } file.clear(); file.seekg(0, ios::beg); while (!file.eof()) { file >> s1; words++; …

Member Avatar
Member Avatar
+0 forum 7

Hello, i have the following query. I have a txt file with data like this: [CODE]1 observational study 1.1 cohort study 1.1.1 retrospective cohort study 1.1.2 prospective cohort study 1.2 cross-sectional study[/CODE] And another file with data like this: [CODE]cross-sectional survey 12345.txt retrospective study 2345.txt ...[/CODE] I want to do an appropriate string matching. To be more specific i want to read each line of the second file and find the one that is similar (or looks kinda the same) from the first file. So for the first line of the second file the "cross-sectional survey" will be assigned to …

Member Avatar
Member Avatar
+0 forum 4

this code is meant to input words from file, and output to file the amount of letters in them and how many words there are [CODE]#include<iostream> #include<iomanip> #include<fstream> #include<cmath> #include<conio.h> #define in_file "data.txt"//input file name #define out_file "result.txt"//output file name using namespace std; void inputwords(int&, int&); void outputwords(int, int); ifstream ins;// associates ins as an input stream ofstream outs;// associates outs as an output stream int letters=0; int words=0; char ch; int main() { ins.open(in_file);// associates ins as an input stream outs.open(out_file);// associates outs as an output stream bool charcheck; inputwords(letters, words); outputwords(letters, words); ins.close();// closing input file outs.close();// closing …

Member Avatar
Member Avatar
+0 forum 7

Hi masters,, how can i count how many words in sentences using pascal? thanks before and best regards.

Member Avatar
Member Avatar
+0 forum 2

how can a user be able to type what ever he wants such as " i went to the park...", i tried to do it but with my string variable it only read the first word typed in, such as i in this case. please help.

Member Avatar
Member Avatar
+0 forum 5

The End.