hi, i am trying to read from a text file and store the data in an array but i don't know how to get started with my code. can someone please get me started here. i have start with the code for locating the file, but i am having difficulty reading the file. Dim strFileName As String OpenAnswerFile.ShowDialog() strFileName = OpenAnswerFile.FileName MessageBox.Show(strFileName) 'message box showing the file path

Member Avatar
Member Avatar
+0 forum 13

A while ago I had a file on my windows desktop with a lot of my email accounts that I use for very specific purposes like online forums or shopping, and each one's password. I don't know what on earth has happened but I can't find that file anywhere. I did a whole "\*.txt" search on the C: but I still didn't find it and I don't remember ever deleting it. What's a good program I could use to recover files and specifcally .txt files? Thanks.

Member Avatar
Member Avatar
+0 forum 3

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

I am trying to create Line objects and add them to an array list. The problem I am having is excluding any lines that are similar to each other. I have already created an equals method that compares two lines to determine if they are equal. I am having trouble using the while loop. I do not have an error message. It compiles just fine. It just will not read from the text file. I am stuck and do not know where else to go from here. public void read( File fileName ) throws Exception { reader = new Scanner(fileName); …

Member Avatar
Member Avatar
+0 forum 1

I need to create a software that manages a bank account. I created 2 forms. Form one (Form1 "in reality is KlientetForm") has 5 textboxes, 6 buttons and a listbox. Form twoo (Form2 "in reality is GjendjaForm") has 3 textboxes (the same name as in Form1), 2 listboxes and 3 buttons. I created the program that it can save the data in text file. I can read the data from Form1 and show the details in listbox. When i select a row in a listbox the items are shown in textboxes. My question is how to show the content of …

Member Avatar
Member Avatar
+0 forum 8

I think this community member will help me to clear my problem. Am not a c++ professional just a beginner. Am on the way to create a software for a browsing center. Am almost struck with the problem of creating multiple text files. To be more clear, Say, a browsing center has 12 computers, so I need to create 12 text files with name comp1, comp2, comp3, ... comp12. and then open them in need and change the data. I tried google.. but in vain. Many example illustrates but din't shoot my requirements. I think u r clear. I need …

Member Avatar
Member Avatar
+0 forum 22

>Write a Java program that recursively reads ten names from a file, and then outputs the total number of characters in the names, the list of names, and the list of names in reverse order. All looping must be performed recursively. > Jay Walker Erol Flintstone C. Erol Madre Billy Pilgrim Mickey Angels José Francisco de San Martín Squarebob Sponge Pants Mischa Ternoff Chester Peak Al Italia Ben Dover Pat Pending I am 100% lost. I would like advice on where would be the first place to start. Thinking about the program, I wanted to build a *main* that would …

Member Avatar
Member Avatar
+0 forum 4

Hello, I would like to know if anybody could help me with this program that im trying. I have a text file with data inside and i want to display one data line per time with 2 sec delay. The data should continue show infinitely. This is what i have done until now [CODE] Private Sub Form_Load () tcpComm1.NodeIP = " " tcpComm1.NodePort = " " tcpComm1.Link Dim iFileNum As Integer Dim FileText as String Dim iLen As Integer iFileNum = FreeFile FileText="Text.txt" Open FileText For Input As iFileNum Do While Not EOF (iFileNum) Line Input #iFileNum, idata tcpComm1.DataOutput (idata) …

Member Avatar
Member Avatar
+0 forum 6

I have a file info.txt like below NAME ID=karan PLACE=Mumbai AGE=23- PHONE=1234 HANDICAP=No- OCCUPATION=Student NAME ID=Ravi PLACE=Goa AGE=25- PHONE=4567 HANDICAP=Yes- OCCUPATION=Employee I want to read the file with make them into record strings as below "NAME ID=karan PLACE=Mumbai AGE=23 PHONE=1234 HANDICAP=No OCCUPATION=Student" "NAME ID=Ravi PLACE=Goa AGE=25 PHONE=4567 HANDICAP=Yes OCCUPATION=Employee" Please suggest how to write a program in C++? Thanks in advance.

Member Avatar
Member Avatar
+0 forum 3

I am trying to write a program that will allow the user to search for a first or last name within a document full of people's names, and respond with the position of that name within the .txt file. What I have right now keeps returning -1 for the position and I'm not sure what's wrong. Any help would be much appreciated. import java.io.*; import java.util.Scanner; class SearchFunction { public static void main(String[] args) { //prompts user for name to search for Scanner input = new Scanner (System.in); System.out.println("Who would you like to search for (family or given name)?"); String …

Member Avatar
Member Avatar
+0 forum 1

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 want to process a text file. Here are the contents of the text file labels 1 -1 -1 0.2988 0.7012 -1 0.188161 0.811839 -1 0.0824541 0.917546 1 0.579515 0.420485 -1 0.0965063 0.903494 -1 0.174624 0.825376 -1 0.0404312 0.959569 -1 0.0770909 0.922909 -1 0.12001 0.87999 1 0.778388 0.221612 In the above data, there are 11 lines (rows) and 3 values (columns) are on each line and every value is separated by a space. The second are third column are actually the probability scores. Now I want to perform 2 actions. 1. I want to access the second column of …

Member Avatar
Member Avatar
+0 forum 3

I am starting a new project and i plan to use c# for it. Basically what it entails to is reconfiguring a large am mount of config files. 100+ of them. They are each named differently but are prefixed the same (ex: CONFIG_FILE_xxxxxx , where x changes). Inside the files also follow a similar structure. My question is how would i go about getting started with this. The reconfiguration i plan to do to these files is edit certain parts of the files depending on their name and then saving them. The editing part is going to come from a …

Member Avatar
Member Avatar
+0 forum 3

Hey everyone, I am working on a function that reads a text file (portion below) of data points arranged in two columns and stores the numbers only in an array of signal[2500][2]. The problem is, I need to do some search and replace on [I]some[/I] of the data points. Some are mV and msec, while others are uV and usec. As there are negative signs on some values, I cannot simply choose the first six places in each line (or similar). My intent is to convert those lines that are mV and ms to uV and usec and then store …

Member Avatar
Member Avatar
+0 forum 4

Hi all, I am trying to figure out the code for searching a text file for a word/phrase and then replacing it. Both are user-input values. I've been having a tough time finding some help online because we are required to use get and put, [U]not strings[/U], unfortunately. The controllers we will eventually be programming will require us to know get/put and the other iostream functions well. My thought process is this: For a search term of "the end" to be replaced by "bye bye" 1. My program needs to save "the end" as an array, search[], and "bye bye" …

Member Avatar
Member Avatar
+0 forum 2

Hi guys i need a little help fast i have a calculator and its giving me some problems This calculator reads from a text file the result shows in the terminal but its giving me some troubles For one only the + operator works I cant use the overflow function correctly it just gives me the overflow message in an infinite loop those are my two main problems and i dont know what to do can anyone help pls [code] MAX_BUFFER equ 2048 ; Constante que sera' usada como tamanho maximo de cada bloco lido do ficheiro (2kb) FICH_ABERTURA equ …

Member Avatar
+0 forum 0

I have inputted a word from a user and i want to find that word in a text file. My text file is like this. -------------- name1:value1 name2:value2 name3:value3 ... ... -------------- So if my user inputs name1 so i want corresponding value1.. How can i do these? Can anyone help me..??

Member Avatar
Member Avatar
+0 forum 9

Hi, For a homework assignement, I'v been asked to write a small school administration system. Currently, the user is able to enter a new student and their age which is then stored in a text file. This all works fine but now I need to load the contents of the text file into an array where the data can then be represented and used. The code is written below [CODE]program school2; USES CRT,SYSUTILS; procedure loaddata; Begin End; procedure enterstudent; VAR name:string; age:integer; currentfile:text; Begin CLRSCR; writeln('Student Name: '); readln(name); writeln('Student Age: '); readln(age); Assign(currentfile, 'C:\Users\lavinia\documents\studentdatabase\studentdatabase.txt'); Append(currentfile); writeln(currentfile, name, ',', age); …

Member Avatar
Member Avatar
+0 forum 1

I cant seem to save these data correctly I have mainly doubles and strings, I am saving these in a .txt file called "autosAudi.txt", I get these weird codes and boxes and sometimes for whatever reason Chinese in my textfields? Here is a example of what appears: [url]http://www.flickr.com/photos/63259070@N06/6449175293[/url] as you can see these weird boxes appear out nowhere I didnt register nothing like that, the way I navigate through the data is by clicking >> (next) or << (previous) and the information is supposed to change, the textfield next to "Numero" is supposed to give me a way to input …

Member Avatar
Member Avatar
+0 forum 5

Is it pasible to find all occurrences of strings "North" and "North-East" in some txt file and save number of occurrences in some variable??

Member Avatar
Member Avatar
+0 forum 17

How do i get my program to read the last ten lines of the ".txt" file? Can you please dumb it down as much as possible. Here is what i have so far: // reading a text file #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("test.txt"); if (myfile.is_open()) { while (! myfile.eof() ) { getline (myfile,line); cout << line << endl; } myfile.close(); } else cout << "Unable to open file"; return 0; } /* An output example: 25: this is line 25 26: this is line 26 27: this …

Member Avatar
Member Avatar
+0 forum 7

I'm trying to find max and min values from a text file which contains data in rows and columns. But I want to create a script which will skip the first couple of lines and calculate the max and min from there on. I am aware for the max and min functions in Python, but I'm not sure how to specify the range. I know I can do something like the following: [CODE] f = open('data.txt', 'r') # Open file data = f.readlines() # Read lines in the file for range(2,...): # Define the range. Is there a way to …

Member Avatar
Member Avatar
+0 forum 3

Hi guys, I have a difficult problem to solve. I have a list with 4 columns of values as follow 750.633 379.039 652.524 1112.63 930.491 452.16 842.753 1191.78 882.063 446.411 787.56 1183.43 434.362 410.174 325.863 1145.34 954.426 445.297 865.449 1183.74 1233.67 194.909 1155.27 908.305 1505.97 917.95 1441.07 1698.01 852.882 133.219 754.444 845.786 429.308 392.396 324.916 1127.72 358.381 310.049 241.12 1037.81 It can be from 10 to 700 raw entries and they are stored in a text file. For the time being I will just focus on the first 2 columns (i just need to keep the other 2 as they …

Member Avatar
Member Avatar
+0 forum 22

Hi all, I need to develelope a code, 'To give the count of [B][COLOR="red"]ANSI ASCII UNICODE [/COLOR][/B]Characters' in particular Text / Html file ? in vb6 ! Any help ... -Kesen

Member Avatar
+0 forum 0

[B]How to read the header of the text file:?:[/B] such as [I][B][INDENT] tab-size tab-stops indent-size line-length new-line use-tabs[/INDENT][/B][/I]need help. Thanks in advance. Senthil

Member Avatar
+0 forum 0

I have a several text files that get updated each month - when they are updated certain lines are missing that I always want adding back to the files - the text I want adding back needs to go into a specific part of the text file(its always the same text that needs adding and same location) Example of the file - [CODE]RAJKOT VARK23 05400228 22.314472 70.785750110.9022800423 HONG KONG VHHH07L12468073 22.310917 113.897967111.1007300022 HONG KONG VHHH07R12468073 22.296675 113.899445109.3007300027 HONG KONG VHHH25L12468253 22.307431 113.932822108.9025300027 HONG KONG VHHH25R12468253 22.321122 113.929639110.9025300022 HONG KONG KAI TAK VHHX31 10930316 22.305500 114.214500109.9031600015 HONG KONG KAI TAK VHHX13 …

Member Avatar
Member Avatar
+0 forum 9

Suppose that I have a text file and I want to insert a character in each of its line at some position. Then can I insert a character there without rewriting all the characters ahead of that position with one position ahead. Like, if I try to do that in C/C++ then before adding a character in the middle of a text file then we need to move all characters ahead of that position with one position so I do not loose any character. So, is it possible in java to do it without moving rest of the characters.

Member Avatar
Member Avatar
+0 forum 21

I have an application that currently operates based on a static password that is hard coded into the application. I would like to somehow have the application look in a text file, say: C:\passtest.txt for a password. The text file will have nothing but the 1 password in it, it is just to make the changing of the password easier than having to recompile it everytime. This is in VB.net. Also, there is no required user name for the application, just 1 textbox (TextBox1) that asks for the password. I suppose the application (upon startup) should read the text file, …

Member Avatar
Member Avatar
+0 forum 4

I have written a code but I am getting run time error : I have introduced all the error functions , but no error comes . Debug it with gdb which says : Starting program: /home/sudhanshu/OpenGL_ES/example/cube/cube [Thread debugging using libthread_db enabled] Program exited normally. What is the problem I am not able to identify, this is what output I get : [B]single-colored solid filled screen to a crash to a blank window to absolutely nothing.[/B] This is my code : [CODE]#include <stdio.h> #include "X11/Xlib.h" #include "X11/Xutil.h" #include <EGL/egl.h> #include <malloc.h> #include <GLES2/gl2.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #define VERTEX_ARRAY …

Member Avatar
+0 forum 0

I wrote a program to analyze a log file for a machine that my company repairs. The program that runs the machine spits output into a text file (.log) and my program will analyze it and return the results of different calculations to the user. The log file idealy looks like this most of the time [CODE] >25 233966 300156 89980 >26 232342 300157 90010 >25 235908 300156 90020 >22 242106 300154 90000[/CODE] This is ideal formatting and USUALLY is the case. Now out of each of those 4 line "paragraphs" only the first and the last lines (eg >22 …

Member Avatar
Member Avatar
+0 forum 5

The End.