38 Topics
| |
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 | |
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 … | |
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 … | |
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 … | |
How to convert a plain text file into a **charsequence** object? | |
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' … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 = … | |
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 :) | |
[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"; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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); … | |
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 … | |
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 … | |
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] = … | |
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). … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.