Hi Dw. I'm trying to read a text file. This text file has a multiply lines and what I want is that I want to separate each line or should I say I want to split each line (chop it) so that I will be able to assign these fields to variables using the array. What I first did is to get the lines then for each line I need to break it. The split I'm using the "*" as a separator. Each line will produce/has 13 fields so I want to get these as a variable. Here is just …

Member Avatar
Member Avatar
+0 forum 12

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

A Dell laptop running Windows 7 Proffessional that has been in use for more than 2 years shows horizontal lines on display seconds after turning on as shown in the [video](http://youtu.be/Fl-xSnwPOCA). Why? What I did was stop using the accumulator for a few months. One day, I put the accumulator in while the laptop was previously powered by cable only. It functioned normally for up to 50 minutes, after which horizontal lines of white, black, pink and green colors suddenly appeared on display. it lasted for about 10 seconds and then screen was black. Caps Lock LED started flashing and …

Member Avatar
Member Avatar
+0 forum 8

I have some questions regarding design pattern (DP) usage, in particular for Java developers. i) Which DPs have you used, as far as you can remember, and how often? ii) How much have they helped your development work? iii) If you work in a project group, are there group standards for architectural and design pattern usage? iv) How can patterns be used more beneficially? v) Did you (or your group) get design pattern training? Thanks for your contribution.

Member Avatar
Member Avatar
+0 forum 10

I am writing a pure C based win32 applications. I have drawn line. Now i want to translate that line, move the line whereved user wants to move on screen. Then again I drawn another line, I am drawing multiple lines. I have created rectangle region for each line and trying to move the line. When I move the 2nd line over the 1st line on screen the 1st line is getting wiped out. Because I am InvalidateRect() of the rect for the line being moved, so when that rectangle is crossing the other line then the other line is …

Member Avatar
Member Avatar
+0 forum 1

Hello everyone! I don't know if I am in the right place to post my problem. My apology. Well I have a problem regarding on my computer. Everytime I turn it on, white vertical bars shows and it takes more than 30 minutes to load. Very slow to start up. This is how it look like ---> http://www.flickr.com/photos/xetness/9370853986/ .. What do you think is the problem of this? And also sometimes this error shows ---> http://www.flickr.com/photos/xetness/9368073383/in/photostream/ . I hope you can help me with this. Any help would be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 3

Firstly, I am a beginner in Java, and I have never been into any programming before, so it seems like I need a little help to solve a task. The task is "I've a text file with the size of more than 5 MB, & I need to clear the contents between the strings CATCH_IN and CATCH_OUT, so whenever CATCH_IN and CATCH_OUT are coming, need to clear the contents between them, after clearing this, white space should be there in the text file I guess, and it should also need to be cleared. Finally , I’m expecting the output would …

Member Avatar
Member Avatar
-2 forum 3

the book is title a guide to c++ progtraming by Tim Corica Write a program that accepts a two digit number and displays the digits each on a single line. The program output should looke similar to : Enter a two digitnumber :27 The frst digit is 2 The second dihit is 7

Member Avatar
Member Avatar
+0 forum 1

hi experts, I have a new quesiton following what I asked before: http://www.daniweb.com/software-development/python/threads/436159/python-remove-lines-when-two-specified-words-in-the-same-line I am still new python user, and hope and get your help again. my task is to do the following Python Remove current and following 3 lines when two specified words in the same line I have a test.txt like this: BNBCD 1.00000000E+00 3.00000000E+00 0.00000000E+00 0.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 2.00000000E+00 BEUSLO 2.00000000E+00 3.00000000E+00 0.00000000E+00 0.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 2.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 2.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 2.00000000E+00 BEUSLO 3.00000000E+00 3.00000000E+00 0.00000000E+00 0.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 2.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 2.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 2.00000000E+00 BNBCD 4.00000000E+00 3.00000000E+00 …

Member Avatar
Member Avatar
+0 forum 8

Hello guys! Please help me with a little problem. I have one table(Person) where are some values. My current syntax is: SELECT Status, COUNT(Name) AS Number FROM Person WHERE Status = 'Married'; Result: Status_________Number --------------------- Married__________3 But I want to get the result for each status. That would be something like this: Result: Status_________Number ------------------- Married__________3 Divorced_________2 Single___________4 Widowed_________1 How to conclude my SQL syntax and get this result? Any help is the most welcome.

Member Avatar
Member Avatar
+0 forum 1

Hello, I am using a HP w1907 widescreen lcd monitor since 4 years. Now abruptly 1-2 weeks befor it showed a very thin verticle line of white colour formarly the colour used to change but now it is white only. after some days a new line appeared adjacent to it it was light red in colour. Now yesterday a new blue coloured line appeared on the far left side. I used snipping tool for taking snapshot and used a camera both the photos are attached and one could say that its the mistake of monitor but what exactly... It looks …

Member Avatar
Member Avatar
+0 forum 2

What I'm trying to do is take a source file and only pull specific lines out and display those lines to a label/textbox/etc. What's happening is I am able to pull the first line, however my loop is terminating and I do not receive the rest of the results. Here is what the source will look like: text1 = text1 text2 = text2 text3 = text3 text4 = text4 text5 = abcdefg (Yes) text6 = hijklmn (Yes) text7 = 1234567 (No) text8 = abcdefg (No) What I want to pull is any data that is marked Yes, so in this …

Member Avatar
Member Avatar
+0 forum 2

Hello! When I power on my laptop (Fujitsu Siemens Amilo Pa) the screen turns grey and after a couple of seconds vertical lines of random color start to appear all over the screen. They change their color constantly. External monitor works just fine (through VGA connection). I disassembled the laptop and checked the data cable that connects LCD and motherboard. I checked every single wire in the cable (rungup with my multimeter) and the cable is absolutely fine (I made a simple pinout schematics). Cable has a sticker: PTT50 LCD CABLE ONE, P/N: 22-12-023-70, CNJS: 2008 (some chinese? characters). Photo …

Member Avatar
Member Avatar
+0 forum 2

In the java policy file what will happen if we comment out //permission java.lang.RuntimePermission "stopThread";. My understanding is that we can't call thread.stop() anywhere in the program am i rite? If we call it should say "Access denied"... If any Text area is built with AWT closing it by clicking on "X" on the window will call this thread.stop() method? Please correct me if am wrong..

Member Avatar
Member Avatar
+0 forum 3

Hi, I am a newbie in C#. I am trying to read a text file line by line (each line has fixed length of 128 numerical values). Text file has more than 300 lines. Now i want to select and copy each line after 5 lines (i.e., interval = 5 or 10) to another text file. For Example, if there are 7 lines and interval is 2, then it should select line 1 and 4 and 7. (2,3 and 5,6 should be skipped because of interval). I have written a small code which reads a text file line by line …

Member Avatar
Member Avatar
+0 forum 2

I'm working on a simple updater program that gets text from a file called version.dv that will always have a number in the form of 1.00, 1.15, 2.00 I can't figure out how to get it to read the file and save the text to a string though. Here's what I have, but I have no idea where to go. If anyone has ideas, I would be in your debt. private void button2_Click(object sender, EventArgs e) { //Open Version.DV //Check number (1.00) //If number is less, update. If not, switch to play now. using (StreamReader sr = new StreamReader("c:\\version.DV")) { …

Member Avatar
Member Avatar
+0 forum 2

Not sure if this has been mentioned - I did search but couldn't find anything that related: Noticed this issue in Opera today. I rarely use the browser, but seems common on all pages with code. The code numbers seem to overlap. ![Capture44](/attachments/large/0/Capture44.PNG "Capture44") As you can see, just the numbering. //EDIT Using Win7/hp laptop

Member Avatar
Member Avatar
+0 forum 6

Hello I have wrote a c program to solve sudokus, and i would like to know if i can draw the grid and fill it using ncurses library. i just would like to know how to control the lines and borders of boxes in ncurses thank you very much

Member Avatar
+0 forum 0

hey there :-) I am facing a small problem, can you recommend me something? my problem is like this: now when a user searches some keywords on my website i extract data of website which includes complete page details. at a time i am fetching 10 results! so now assume while($out=mysql_fetch_assoc($res)) { echo $out['full_txt']; // this echos complete page i.e. each and everything on page! // this $out['full_txt'] is a string! } Now what i want to do is Depending upon keywords searched, i want to extract lines from this full_txt . Eg. I searched "hello world" then i want …

Member Avatar
Member Avatar
+0 forum 9

Hello everyone. I'm working on a program which should edit a text file by adding/deleting some specific lines. By default this text file doesn't have these specific lines, so the program will add them. But I also want it to replace them if they're already in the text file. Basically this is my idea: - Read the text file - Search the specific lines - If they exist then replace them - Else add them I pretty much know how to read a text file, how to search for specific lines, how to replace them and how to add them, …

Member Avatar
Member Avatar
+0 forum 4

I am very new to VB.NET, I want to create a Forms Application to load a text file that has lets say 50 lines, some of the lines are identical and those are grouped together and some same format but different make up. Have it loads it into a text box in the form, to see - but I want another button to randomize all the lines and then show that in the box, and then have a Save button to overwrite the orginal. Example of .txt. line of text aa line of text aa line of text bb line …

Member Avatar
Member Avatar
+0 forum 3

Hi, I am trying to split a single line of data into three separate parts so that they can be displayed in different textboxes. The data looks like this: item1_item2_item3 The code that I tried is: [CODE]Dim arrayLines() As String Dim record As String record = Subs.Text arrayLines = record.Split("_") TextBox1.Text = arrayLines(0) TextBox2.Text = arrayLines(1)[/CODE] I don't seem to have much luck, I don't even get an error message when I click on the button. Any suggestions..?

Member Avatar
Member Avatar
+0 forum 2

Basically, i've been told to initialise a grid into the "canvas" section of this program i've made, I need to make a fine grid that stretches across the whole canvas horizontally and vertically, 10 x 10 pixels apart example of the code i'm editing to do this below... [CODE] class Canvas extends JPanel { // Called every time there is a change in the canvas contents. public void paintComponent(Graphics g) { super.paintComponent(g); draw(g); g.setColor(new Color(0.8F, 0.8F, 0.8F)); g.drawLine(10, 800, 10, 10); g.drawLine(20,800, 20, 10); g.drawLine(30, 800, 30, 10); g.drawLine(40,800, 40, 10); g.drawLine(50, 800, 50, 10); g.drawLine(60,800, 60, 10); g.drawLine(70, 800, …

Member Avatar
Member Avatar
+0 forum 7

[CODE]string[] lines = System.IO.File.ReadAllLines(@"C:\Users\Admin\Desktop\ID.csv"); string sPattern = idBox.Text; foreach (string s in lines) { if (System.Text.RegularExpressions.Regex.IsMatch(s, sPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { nameLabel.Text = "test success"; } else { nameLabel.Text = "test failure"; } }[/CODE] This is basically what I have so far. I am using Visual C#, which is probably obvious, but just in case you didn't know. ID.csv includes: 123456a, 123457b, 123458c I want to separate the IDs into separate lines, and be able to search within the string. If someone enters 456, I would like nameLabel.Text to output the entire line from within the string[]. I know i will need …

Member Avatar
Member Avatar
+0 forum 4

Hi, I've been searching around these forums for quite a while now, and can't seem to either understand or find what I'm looking for. ^ As you can probably tell, I'm a real Novice to VB! I have a text file, that my program is always adding to it, it's format is like so: Line 1: UserName (For User 1) Line 2: FilePath (For User 1) Line 3: UserName (For User 2) Line 4: FilePath (for User 2) For Example: Line 1: Tobyjug2222 Line 2: J:\Program name\bin\Debug\Accounts\Tobyjug2222 Line 3: Toby Line 4: J:\Program name\bin\Debug\Accounts\Toby ... ... My program automatically writes …

Member Avatar
Member Avatar
+0 forum 8

Hi:) I want to change the formatting of a rich text box's selected text with lines of different sizes. For example if I have written " [B]I code in VB[/B] " (any font, size 72, bold) on the first line and " [I]VB is easy[/I] " (any font, size 48, Italic) on the second. I want to change it when I click a button to make both like: " [B][U]I code in VB[/U][/B] " (any font, size 72, bold, underline) on the first line and " [I][U]VB is easy[/U][/I] " (any font, size 48, Italic, underline) on the second. Note …

Member Avatar
Member Avatar
+0 forum 5

I want to remove blank lines (empty or with spaces and tabs) from a file from within a perl script. here's what i tried. [CODE]`sed '/^ *\$/d' $file1`;[/CODE] Does not seem to work for some reason. Any Help please?

Member Avatar
Member Avatar
+0 forum 3

I am editing an image of a subway map in photoshop. I have edited out all but the colored lines and thickened them with the stroke tool. Unfortunately each line has a few gaps as well as ridges along the edges. I would like a smooth, solid line. What is the best way to get rid of one or both? Thanks!

Member Avatar
Member Avatar
+0 forum 4

Hi Im a beginner in programming C# while watching this tutorial on C# (writing a console application) the guy skipped over a couple segments in between parts of code. Where he was doing "if" statements of " if (input3 == "n" (vertical lines here) input3 == "n"). Im wondering how was he able to type that is that a feature in visual studio? What keystroke is it? The significance and what does it mean.. Thanks!

Member Avatar
Member Avatar
+0 forum 4

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

The End.