27 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Matthew N.

Hello, I'm trying to write data to an INI file, I've got some code to read it: [http://pastebin.com/Jpwf8XJM](http://pastebin.com/Jpwf8XJM). I've tried to modify this code to get it to be able to write to INI files, but I haven't had much success. I know there are DLL's designed for this, but …

Member Avatar for jehernandez757
0
3K
Member Avatar for Mr.M

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 …

Member Avatar for Mr.M
0
598
Member Avatar for entropicII

I have recently been writing some code that asks the user questions about german. br = new BufferedReader(new FileReader("C:\\Users\\Patrick\\Desktop\\Java Workspace\\germanTool\\src\\germanTool\\lesson1.txt")); String[] engList = null; String[] deuList = null; int i = 0; while (br.readLine() != null){ lineCount++; line = br.readLine(); engList[i] = line.split("\t")[0]; deuList[i] = line.split("\t")[1]; } Using this code …

Member Avatar for entropicII
0
217
Member Avatar for CreatorZeus

I'm having a simple i/o with file problem. I have the name coming from a string but it just wont open at all. Incoming code: string notename[] = {"NULL","empty"}; ifstream readnote; readnote.open(notename[x].c_str(),ios::in|ios::out); if(!readnote) { cout << "Read Error"; } its prolly something small but i keep getting the error, can …

Member Avatar for CreatorZeus
0
281
Member Avatar for castajiz_2

int main(int argc, char** argv) { FILE *f; char string[100]; int counter=0; f=fopen("New Text Document.txt","r"); if (f==NULL) { printf("error"); } while(!feof(f)) { fscanf(f,"%c",&string); } fclose(f); for(int i=0;i<100;i++) { if (string[i]=='a') /*doesnt work, why?*/ { counter++; } } printf("\n the number of vowels a is : %d",counter); getch(); return 0; } …

Member Avatar for deceptikon
0
143
Member Avatar for Stpdoug

Hey guys i am having a problem with displaying a single record out of a text file the code is not reaching the "if" function in the while loop of the "getRecord" Function please help. Everything else is working import java.io.*; import java.util.Scanner; import java.util.InputMismatchException; public class FileTest { //Globals …

Member Avatar for Stpdoug
0
325
Member Avatar for Labdabeta

Hello. I am wondering how EOFs are indicated to either the cstdio functions or the fstream functions. Mainly I am wondering how it differentiates it from data. For example, if EOF is a 2-byte code wouldn't this break the system by inserting a 'false' eof flag: for (int i=0; i<256; …

Member Avatar for Labdabeta
0
177
Member Avatar for Jorox03

I am trying to write some code to regex search against wide strings. The problem I am having is that the regex operations ( `regex_search` in particular ) does not take in wide arguements. Here is the snippet I am having trouble with: Function Header: void scan_filesystem( wpath const& f, …

Member Avatar for Jorox03
0
6K
Member Avatar for Jorox03

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 …

Member Avatar for Jorox03
0
3K
Member Avatar for jspence29

What I am trying to do is make a program that reads a txt file and converts the number into a double array. import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class rocket { public static void main(String[] args) throws IOException, FileNotFoundException { System.out.println(readLines("/Users/Jeremy/Documents/workspace/altitude.txt")); } public static Double[] readLines(String …

Member Avatar for jspence29
0
380
Member Avatar for yup790

In the main class the user enters text trying to find the file in the same directory as the source file. The string gets passed into the constructer and a file object is made but the file isn't found. The print statements are just to find out what is happening. …

Member Avatar for yup790
0
385
Member Avatar for fheppell

I need to build a gift voucher section of my python cash register software Here's the code I have so far elif payment == '3': print "Scan or enter gift card" cardno = raw_input('Card Number: ') try: with open(cardno, '.txt') as f: pass value = f.readline() except IOError as e: …

Member Avatar for Lucaci Andrew
0
155
Member Avatar for foodstamps

I'm trying to process a list contained within a separate text file. I am able to read the file, and generate an output containing the contents of the file, but the output generated is the unprocessed version, identical to the input. I do not encounter this problem when the list …

Member Avatar for foodstamps
0
308
Member Avatar for iamcreasy

Hi, I used to solve ACM problems, but I used old scanf & printf for input and output.But now i want to use C++ style IO. So, i picked a simple problem, and tried to convert its old style IO to new style IO. The problem : [URL="http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=996"]http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=996[/URL] (in summery, …

Member Avatar for iamcreasy
0
259
Member Avatar for rahul.ch

import java.io.*; public class Mac extends Laptop { public static void main(String r[]) { new Mac().crunch(); } //insert code here } class Laptop { void crunch() throws IOException { } } The question is simple. Insert a code that will make the program compile. Answers are: `void crunch()` or `void …

Member Avatar for NormR1
0
212
Member Avatar for VengefulToast

Will someone please tell me why I keep getting my custom file not found exception? The file is spelled correctly and is in the same directory of my java file. I am programming on Eclipse on Mac OS X. Here is my source: // Dillon Sheffield // Lab 10a // …

Member Avatar for VengefulToast
0
269
Member Avatar for Tobyjug2222

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 …

Member Avatar for Tobyjug2222
0
296
Member Avatar for efronefron

the problem is if you increase buff size and also change the buff size in a3_fgets_2 function call to more than 15, the program will run in an infinite loop, Can anybody tell me why? Thanks [CODE]#include<unistd.h> #include<string.h> char * a3_fgets ( char * str, int num, int fd ); …

Member Avatar for efronefron
0
252
Member Avatar for RedexProGamma

Hi, I am NOW doing a short application that installs a program, without the program being embedded into the application. I have found myself at a loss for code, now that I cannont figure out how I can COPY the entire contents of a folder to a new folder, WITHOUT …

Member Avatar for codeorder
0
440
Member Avatar for naffan

Hi All, I've a little problem with writing and saving to a file I'm close but I can't seem to grasp what i'm doing wrong here. Trying to save student object(s) to allstudents.txt This is my loadStudent method; [CODE]public student[] loadStudent() throws IOException, ClassNotFoundException //loads the accounts and returns them …

Member Avatar for naffan
0
160
Member Avatar for Poopster01

I have the following error on line 71 and I'm not sure whats wrong with that statment any explanation would be greatly appreciated. C:\Users\peter\Desktop\CSC 111\welch_lab4\welch_lab4.java:71: cannot find symbol symbol : method equalsIgnorCase(java.lang.String) location: class java.lang.String while (!(response.equalsIgnorCase(FLAG))) ^ 1 error Tool completed with exit code 1 This is the details …

Member Avatar for Poopster01
0
171
Member Avatar for insanely_sane

Hey guys. So I want to learn how to do a simple I/O to and from a file. I want the simplest way to do this. My teacher sent me her program but I don't think I get what she is doing and it's giving me an error. So I …

Member Avatar for Progr4mmer
0
212
Member Avatar for cousinoer5

I'm taking an advanced C++ class now, and everything up to now has been pretty simple (mostly review stuff), but now we got to binary file io and it's kicking my butt. This program is supposed to read from a file called "Hardware.dat" (or create it if it doesn't exist), …

Member Avatar for cousinoer5
0
471
Member Avatar for yongj

I have an application that allows the user to open a file by clicking file -> open. The thing I'm trying to do is read the text file...but I don't know how to assign the user defined text file that the user opened to an object. I guess because I …

0
107
Member Avatar for iamchuckb

Hi all, I'm new here and a little flummoxed by this problem. I am working through the process of creating a notepad type program in java to get a little more experience with the language. My save functionality is not working. This is not unexpected; the part that is really …

Member Avatar for iamchuckb
0
4K
Member Avatar for redZERO

Hi everyone I have a project that I have created in Netbeans. I would like to deploy it as a JAR file, so i have "build"'ed it and I have a jar which runs nicely in the /dist folder. Problem is, the program in question requires reading from and writing …

Member Avatar for NormR1
0
2K
Member Avatar for ans025

Hello I am very new to Java and I really don't know exactly what I am doing. I know a little bit of other programming languages so I'm trying my best to figure it out for myself but I am supposed to: [B]Write a Java Application which will read a …

Member Avatar for NormR1
0
1K

The End.