38 Topics

Member Avatar for
Member Avatar for nouth

It is possible to read/write the binary of any file with using Python? `open(file, "b")` only works for windows `"rb"` `"rb+"` `"wb"` `"wb+"` `"ab"` `"ab+"` works but `.read()` just prints the file contents not its binary

Member Avatar for nouth
0
696
Member Avatar for Emma_3

I'm supposed to just read a file and display certain information. I wrote the file in notepad and have it in the correct folder for my project, but when it opens (it DOES open), it doesn't display anything. Ideas? #include <iostream> #include <fstream> using std::cout; using std::cin; using std::ifstream; int …

Member Avatar for Moschops
0
277
Member Avatar for Tony.Z

My code only outputs 0.00 when 'y' is entered. Clearly, I'm a beginner. #include <iostream> #include <iomanip> #include <string> const double ADULTFEE = 18.00, CHILDFEE = 7.50, TRAINFEE = 6.00, BIRDFEE = 5.00; using namespace std; int main () { char reply = ' '; double adultNum = 0, childNum …

Member Avatar for RonalBertogi
0
407
Member Avatar for borchu

Hello everyone, I am new at Java(android)-before I have little information about Java lang- and in particular socket programming -before I do not know nothing about socket client server programming-, previously I wanted to write simple chat program by using Threads and now I pass this step, two android emulators …

Member Avatar for borchu
0
970
Member Avatar for winecoding
Member Avatar for denethor

Hello do you know whats wrong with this code? #include <stdio.h> #include <allegro5\allegro5.h> #include <allegro5\allegro_primitives.h> #include <allegro5\allegro_image.h> int main() { al_init(); FILE* pFile; return 0; } If I compile it, it fails and output is: main.c 1>c:\users\beda\documents\visual studio 2010\projects\c allegro\c allegro\main.c(9): error C2143: syntax error : missing ';' before 'type' …

Member Avatar for Ancient Dragon
0
181
Member Avatar for learning.java

Write a java program that will open a file, read each of the records from the file, use that data to populate a two dimensional array and write the sorted data out to a new text file. Define a class named [B]Munge[/B] which will do all the 'heavy lifting' in …

Member Avatar for stultuske
0
187
Member Avatar for nickecarlo

I have the following piece of code. I do not understand why its not working. I'd really appreciate help on this. [CODE]import java.util.Scanner; import java.io.*; class ReadFiles { String [] codes = new String[99]; int i = 0; private Scanner readCodes; public void openCodesFile() { try { readCodes = new …

Member Avatar for nickecarlo
0
10K
Member Avatar for pythonstudent11

What I'm trying to do is read a line from a file containing some data that includes a person's first and last name, their hourly wage and the number of hours they worked, and then writing to a seperate file their last name, first name: wage. The input file looks …

Member Avatar for pythonstudent11
0
318
Member Avatar for Prisms

Whats up everyone I have a question, but first of all I know how to read a file, write to it and all that good stuff I was wondering how do I manipulate data from one. I want to take this .txt file and compute the gpa by taking the …

Member Avatar for Prisms
0
181
Member Avatar for Prisms

Hey guys I have this code snippet and I want to read from this file and print the contents of my text file (Transcript.txt) to the screen. I don't have any errors but when I run the program it prints "Display it to the standard output" instead of whats on …

Member Avatar for NormR1
0
238
Member Avatar for Jetster3220

Task: • Create a text file with 5 questions in it. • Read each question in from the file. • Ask the user for their response. • Create a new text file. • Write the user’s answers to the text file. • Ask the user if they’d like to review …

Member Avatar for woooee
0
306
Member Avatar for anuran

iam building a training set for spam filtering using java,training set data is given as words in text files in one folder,but im unable to debug whats going wrong in java collections [CODE]/* *folder part 1 conatins various text files having name format * **spmsg***.txt and ***legit***.txt e.g 11927legit569.txt ,106127spmsgc26 …

Member Avatar for anuran
0
169
Member Avatar for manish250

hello all i am doing a copy operation from a file to another file.in source file i have 13 digit no but in destination file there is only 12 digit copied.code is as follows. [CODE]public void createOriganalFile() { try { File ObjInputFile1 = new File(strFilepath + "_dummy.txt"); File ObjOutputFile1 = …

Member Avatar for hfx642
0
191
Member Avatar for chhabraamit

HI, I am looking for faster input and output method for the C other than just normal scanf and printf modules. Please elaborate by simple example. thanks :)

Member Avatar for Narue
0
309
Member Avatar for munitjsr2

[CODE] #include <iostream> #include <fstream> using namespace std; int main() { char ch; ofstream outf("ITEM.txt"); cout << "Enter item: "; char name[30]; cin >> name; outf << name << "\n"; cout << "Enter item cost: "; float cost; cin >> cost; outf << cost; cout << "written to file item.txt\n"; …

Member Avatar for munitjsr2
0
316
Member Avatar for bleedsgreen33

My professor has thrown me a curve ball with this next assignment. The assignment is to make a Monthly Accounting Statement, the program is to you structs and arrays. I get how you can have an array of structs, arrays within a struct, etc... I have the program mapped out …

Member Avatar for Ancient Dragon
0
359
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 thought this program was as good as done, turns out, it's more broken than I thought! Right now I'm in a panic, since it's due tomorrow, and I have a few big problems with it. Problem 1: I need to either open an existing file, or a new one …

Member Avatar for cousinoer5
0
203
Member Avatar for erogol

I am newbie in C programming and I have a easy assigment but I coul not do that. I need to read two number from a file, add them, print them that is all. Here is the my code. [CODE] #include <stdio.h> #include <stdlib.h> int main(void) { FILE *fp; fp …

Member Avatar for gerard4143
0
4K
Member Avatar for bookmark

Hi, I'm trying to make a program that reads a text file that contains about 4 rows of numbers and outputs the average for each row. I need help with these two errors. It is not complete but I need help on these so I can continue. Any help is …

Member Avatar for Perry31
0
185
Member Avatar for jishent

[CODE]import java.io.*;public class Ex9a{ public void rollBack(BufferedReader in) throws IOException{ String line=""; if((line=in.readLine())!=null){ rollBack(in); } if(line!=null&&!"".equals(line)){ System.out.println(line); } } public static void main(String[] args) throws FileNotFoundException{ PrintStream out; Ex9a t=new Ex9a(); out = new PrintStream(new FileOutputStream("outfile.txt")); out.println(ioe); out.close( ); String fileName="infile.txt"; try{ BufferedReader in=new BufferedReader(new FileReader(fileName)); t.rollBack(in); }catch(IOException ioe){ System.out.println(ioe); …

Member Avatar for jon.kiparsky
0
381
Member Avatar for adaniel058

I can not figure out why my code is reading in data to my vector in funny ways. I have added the input file and necesary class to test. It seems to be skipping values in the input file and also adding things to seperate places in the vector instead …

Member Avatar for kramerd
0
228
Member Avatar for jos_t_tarigan

hi, im trying to read and write an array of integer to/from a file. i use this to write to a file: [code=c]fwrite(texel, sizeof(int), size, fp);[/code] and this to write it: [code=c] (*out) = new int[size]; fread((*out), sizeof(int), size, fp); [/code] but the data read from the same file is …

Member Avatar for Ancient Dragon
0
204
Member Avatar for lionaneesh

I am trying to solve the problem Present at [url]http://www.codechef.com/problems/INTEST/[/url] I have made a small Python script to do my job :- [CODE]array = [] no_lines = 0 no = 0 j=0 div_no=0 no_lines = input() no = input() temp = no_lines while(no_lines>0) : i=0 i = input() array[j] = …

Member Avatar for TrustyTony
0
782
Member Avatar for Sismetic

Well, I have a test program, in which I wanted to test if it was possible to open a textfile(text.txt) for input, display it via cout, then passing the object via reference to another function, in it and display the file again(which should already be open,which is the whole point). …

Member Avatar for Ancient Dragon
0
226
Member Avatar for strwbry.coder

Good day, everyone. I am refreshing my c++ skills from a year break or so :$ I am having some troubles remembering on how to write to a file. I have the general idea down, but I am not sure what I am doing wrong. I would be much appreciative …

Member Avatar for mrnutty
0
200
Member Avatar for r1409

hi all i have an assignment in which i have to use object-oriented programming to read from an input file(say: input.txt), use prim's algorithm and calculate the weight of a minimun spanning tree and then save the output to a file(output.txt). the problem with my code is that the program …

Member Avatar for daviddoria
0
625
Member Avatar for Mum2Charlie

Hi, first let me stress - I have no real computer knowledge and most of the phrases etc mean nothing to me! I'm a stay at home mum and work from home making stationery etc and my husband bought me an external hard drive to back all my work up …

Member Avatar for Mum2Charlie
0
284
Member Avatar for maf5693

hi I have been looking around for a good file io tutorial and I cant find any. It is simple enough to me the process, mov dx,043h mov al,54 out dx,al etc. but i have no idea which ports go to where or how to write to a hard disk …

Member Avatar for maf5693
0
236

The End.