7,373 Topics
![]() | |
So, what Im trying to do here is a client server socket program. The client will ask a question to the server. For example, How are you? Then the server opens a text file, compares the string from the client and outputs the answer to the client. My text file … | |
I have the following code, which reads from the .csv file and simply displays the output as whatever is being read from the .csv file...(which is test1.csv in the test1.zip attached with this post) //class to read CSV file : import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; public class readCSV { … | |
does anyone know why this does not work? [CODE]public class AddStudentListener implements ActionListener { public void actionPerformed (ActionEvent event) { //Changes title Title.setText("Add Student"); //Obtians student information from the user Object[] possibilities = {"IB Computer Science", "AP Computer Science", "Algebra II"}; StudentClass = (String)JOptionPane.showInputDialog(All, "What class is \nthe new student … | |
I am trying to read some numerical values from a file and getting this error: Input Error: Error in input: Floating point number not found.; Expecting Real number in the range -1.7976931348623157E308 to 1.7976931348623157E308 [code][code=java] import java.io.*; public class TriangleMain { /** * @param args the command line arguments */ … | |
why my executable jar file created in Netbeans cant write/output a .txt file. . .my program must create a text file and write with it, how can it doesn't work when i convert it to .jar but if i run it in netbeans it work fine?.. | |
Hello friends i have been facing problem in reading from a file consisting of both float values and strings.In need to read them and print them out. The input in the text file i have been using is 0 5.1 3.5 1.4 0.2 setosa 1 4.9 3.0 1.4 0.2 setosa … | |
When i type in the following link manually in firefox as " file://///172.16.2.1/copyediting/ELS/mallet.pdf", pdf file is loaded successfully in the firefox browser. PDF file is located in remote server which is referred by IP 172.16.2.1. I've assigned the Same link in a String in jsp page and tested it through … | |
Could anyone help me splitting a big file into subfiles. The file is something similar to this: 1.SYSTEM = UNIX 2.variable = value 3.>ACTIVATED 1 4.ALL: FILE1 5.ALL:FILE2 6.ALL:FILE3 7.ALL:FILE4 8.>ACTIVATED 1 9. ################* 10.>>CONDITIONS 11.################ 12.MODEL: 13.<one ExeSimpleName> : <one or more Flags> : [Options] I need to split … | |
Hi, I'm having issues with a program that concept-wise sounds very simple. The program should read in data from a text file (attached a2.txt), and perform stack and queue operations upon the data. The data consists of long math problems, dealing with order-of-operations. The correct output that should be appearing … | |
i have got this done so far but it still isn't working properly its really doing my head in it sends the message fine subject file attachment but cuts the html message off halfway down and doesn't send the disclaimer if i change $message which is being passed to $messagemain … | |
hi...can somebody give me a little help here. i get error message : 'file' object is not callable its a program that call shell script (shell script run "fusion.deb"). here`s the code: test.py [CODE]#!/usr/bin/env python import sys import os try: import pygtk pygtk.require("2.0") except: pass try: import gtk import gtk.glade … | |
I have a class Friend: [CODE]public class Friend { public string friendName; public string friendStreet; public string friendCity; public string friendState; public string friendZip; public Friend() { } }[/CODE] and I am using a ArrayList called friendArray. I have a text file that is formatted like this: My Name My … | |
From the front page of this section I have had the gay porn fetish thing and the prunnet.exe (also from a website that suddenly got taken down) and now badly affected (somehow) by the generic host processes. I also have the red X next to the clock that I have … | |
asked to do something that is I suppose a little strange. maybe because it's out of the blue and never tried it before. Essentially take a .txt file and split it up into 4 files. (no criteria on size, readability etc.. etc. ) Just split it up.. give each a … | |
target.php: xas xjahs dajdh ajdhjas da d xxxx na dh ada hd main.php: <?php // removal malicious script by forzadraco $filename="target.php"; $existfile=@fopen($filename,"w"); if($existfile){ echo "file berhasil dibaca \n\n"; }else{ echo "file gagal dibaca \n\n"; } if( false == ($str=file_get_contents( $filename ))) echo "Could not read file."; else echo "File contents: … | |
how do I send a text file to a printer connected to the client's computer. I have a vb.net app. running currently with internet explorer only browsers. I constructed some texts based on the inputs from the user and need to (a) save it on the client file system (b) … | |
Hey, thanks in advance for any help! I need to search a file for a specific word starting on a newline then skip a SPACE and read the next word into a char array or string, and then skip a word and read the next word, stopping at the next … | |
I'm sorry, I didn't realize I couldn't upload the exe file - but I have it ready to email. I'm having a big problem understanding how to complete this assignment and would really appreciate someone's help in getting me started. Basically, we are taking baby names from a file and … | |
Ok...so I have a project due in 3 weeks and I haven't started. If i don't get it done I won't be able to graduate...the problem is i don't get java AT ALL...if anyone is willing to help me out with parts of the project..i would deeply appreciate it. I'm … | |
Hi all, The program I'm making needs to basically interpret long math operations (see the attached text file) and compute them. Simple right? I have to use stacks and queues to reorder the operation into the desired output (the output will compile properly if you run the program as it … | |
Hi, I've been trying to get my head around x86 assembly lately, and I've been working on this one problem. I'm trying to write a program that reads characters from a text file, then display them on the console. It's a simple exercise in file operations, but I'm having a … | |
Can somebody tell me the file read and write syntax. I found the following code on the net. but didnt get that. fs2.Read(fs2Content, 0, (int)fs2.Length); fs1.Write(fs2Content, 0, (int)fs2.Length); what exactly first, second and third arguement will do in above statements. pls give me some details regarding this. Thanks | |
Hello everyone I am new to the forum I have a question. I created a method foo(ifstream &myfile) and works only if executed ones. In a loop or consequtively calls make the cerr call [code]int foo( ifstream &infile){ if (!infile) { cerr << "Unable to open file "; return -2; … | |
I'm in the middle of writing a program where I want to use a single function to grab a Username from one file and a Password from another file. The idea is to pass the file pointers to the function so that each time the function is called it returns … | |
I found some very helpful articles on this site, but I'm having trouble with this one... Here is the applicable batch code: [code]@echo off > %AppData%\PROGRAM\NEW.INI setLocal EnableDelayedExpansion find "DESIRED STRING" < %AppData%\PROGRAM\EXISTING.INI > nul if not errorlevel 1 goto :FOUND for /f "tokens=1 delims=[] " %%a in ('find /n … | |
Hi, i have opened a file from a python sript using built in function 'file'. after reading data from that file, i closed the file descriptor and tried to delete the file but it gives an error that file is being used by another process whereas none of the process … | |
[CODE=cplusplus] #include <iostream> #include <sstream> #include <string> #include <fstream> using namespace std; int main(void) { for(int COUNT = 0; COUNT <= 1000; COUNT++) { if(COUNT > 1000) { break; } if(COUNT <= 1000) { std::string TO_STRING; std::stringstream OUTPUT; OUTPUT << COUNT; TO_STRING = OUTPUT.str(); ofstream myfile; FILE.open ("data.txt"); FILE << … | |
I have the following code it works for mpg files But it grabs every frame of video I want to grab Single particular frame or/at particular time plz help me and post the modified code Its urgent Code: import java.awt.*; import javax.media.*; import javax.media.control.TrackControl; import javax.media.Format; import javax.media.format.*; import java.io.*; … | |
Hi,guys, I am new to C++,and recently I practice to read a file with visual studio 9.0,but it turns out that it cannot find the very file! [code] #include<iostream> #include<fstream> #include<string> #include<iomanip> #include<cstdlib> #include<vector> using namespace std; //using namespace stdext; int main() { ifstream inClientFile("Dic.dat",ios::in); if(!inClientFile) { cerr<<"File could not … | |
I wand to give the user the ability to upload as many pictures as he wants to. at present I hava a fexed amount of browse fields wich the user can use to select pictures... the code looks something like this : [code] <?PHP $max_file_size = 3000000; ECHO "<FORM NAME=name … | |
Hi, guys i need some help! i need to make a txt file with the "-A" command (in shell). that already is implemented in the client, then the client send the file thru sockets and arrive to the server, the server save the file in his directory. But the code … | |
Hey, I am having trouble with the file I/O part of this program. It seems to start at the end of the files contents and not go into the while loop. [code] #include "queue.cpp" #include <iostream> #include <fstream> #include <iomanip> /******************************************* * class Priority * * Takes input from file … | |
I'm new to C++ and I can't seem to find the problem with my code. I have a function that opens an input file. It asks you to input a file and if it can’t open the file it asks you if you want to try again. If you answer … | |
Can somebody please help me with this code? I have the program correctly coded and operating properly, however, I forget how to write my output to a text file. Can somebody please help me here? Thanks. [CODE] /** * This program calculates the monthly Heat Index for a specific city. … | |
My coding looks like this int main(int argc, char *argv[])/*command line input*/ { int len; char *t[10]; len=strlen(argv[argc-1]); temp[0]=argv[argc-1] if(strstr(t[0],"c"==NULL)/*to check for a c file input*/ printf("Not a c file"); else printf("C file"); } if my command line input in linux is ./a.out test.c argv[0] contains ./a.out ans argv[1] contains … | |
I am developing an application in Java that grab Image from the video. I have the following code that grabs a frame every given no. of seconds but i want an Image afte each click Even the given code does' nt work Plz help its urgent Thanks in advance : … | |
Hi, I am facing a problem, I am accessing a text file through my C program to fetch some values. The problem is that, i want to check whether the text file is updated before opening it, as i want to save the time of opening the file again if … | |
Hello, I've got the following code: [code] wxString path = filepath; wxString newpath = filepath; fstream f(path.Append("/tests/tests.bin"), ios::in | ios::binary); fstream fnew(newpath.Append("/tests/temp.bin"), ios::out | ios::binary); Test* transferTest = new Test(); int thisSize = sizeof(Test); bool success = false; bool toBeDeleted = false; int testNo = 1; if (f) { f.seekg(0, … | |
[code=cplusplus] #include<stdio.h> #include<stdlib.h> #include<iostream.h> main() { FILE *fp,*fp1; int numbers[30]; char *buffer; int i=0,j; // To read the file fp=fopen("PR1.txt","r"); if(fp==NULL){ printf("Error: can't access file.c.\n"); exit(1); } else { printf("File opened successfully.\n"); for(i=0;i<10;i++) { // while(!feof(fp)) { /* loop through and store the numbers into the array */ printf("Number- %d", … | |
Hi! I am new to C and need some advice here. I have a solution to this problem but I still think there should be a way to do this more efficiently: I have a file where I have stored null-terminated strings including the '\0' char. I now want to … | |
Hi, I am in problem. I have written some code in VC++.NET 2008. It is using third part AMT SDK. It is using file handling of C using fopen() function. The file are opened in binary mode (rb). It is working very perfect according to our requirment on my local … | |
Project Name : " Employee Information System " I am trying to add a new department name in "dept.txt" file. using file Operations and funcctions defined in String Header file in C Problem is in fnAddDepartment() function. When i run program in VC++ compiler, it says : Debug Assertion Failed! … | |
Visual C (2008) is acting as if I never included a header file (wave.h) that I am using, but the #include statement is definitely there. Here's my main (BPM analyze.c): [CODE=C]#include "stdafx.h" #include "common.h" #include "sound.h" #include "wave.h" int main(int argc, char* argv[]) { SAMPLE samples[2]; unsigned int i, j; … | |
is there a way to contain the text in a normal format when writing out to a text file? By this i mean, if i have cout output a million a's, instead of one long line if u open and view the txt file, it is many rows. Thanks | |
Hello sir, I am using VS2008. I am using save file dialogue box and i am saving the contents of richtextbox which is in the form. So i used the coding below. It only creating the empty file but not the text which i typed in the richtextbox. [CODE]Private Sub … | |
I have a program for advanced VB in which we are to create a Struct of account records that are in a Text file and close the text file after opening and read the file in to the form window from the Struct and be able to edit the data … | |
am trying to append to file but its not going correctly every time it fail to connect to file [code] #include<iostream> #include<fstream> using namespace std; int main() { fstream file; char word[256]; file.open("StudentInfo.txt",ios::app); //file.open("StudentInfo.txt",fstream::app); // wont work too if(file.fail()) { cout << " Error opening the file " << endl; … | |
I have all my code for this. I have the code to read a txt file, write a txt file, convert the infix to postfix and evaluate it. I am now just having trouble putting it all together. I need it to read the text from a file convert each … | |
Hi, I stored a file in the folder taht selected using file upload control. When I tried to view this content from that folder I got an error like this. Cannot find the C:\Documents and settings\Terapc\LocalSettings\temporary Internet Files\Content.IE5\6AJ9DNHZ\name.txt file Do you want to create a new file? The code I … | |
I am trying to write some simple information to a file and i am getting the error message "No such file or directory when i know full well it exists. If you take the url [url]http://www.adamplowman.com/uni_project/log.txt[/url] you get the file heres the code [CODE]#!/usr/bin/python print "Creating a text file with … |
The End.