6,015 Topics
![]() | |
Hi, I have a rather large binary file that I am attempting to read in, but I only want to read in the first 100 characters or so. I've tried searching the internet for help or an example, but I've only found examples that read in the entire file...and this … | |
I have three files that I need to link using a makefile but I continuously get undefined function errors and I cannot figure out why Makefile[CODE]# sectool.make CC = g++ CFLAGS = -c all: sectool sectool: Transposition.o Substitution.o System.o ${CC} -o sectool Transposition.o Substitution.o System.o System.o: System.cpp Transposition.cpp Substitution.cpp Substitution.h … | |
Hello everybody ! I'm a novice , and already started learn C++ . I try sorting string alphabetically from a text file . This is my code [CODE]#include <iostream> #include <fstream> using namespace std; // Quick Sort function void quickSort(char A[][15], int lower, int upper){ if (lower>=upper) return ; // … | |
Hi guys, I hope you can help me with a bug. I have an update form to update data in a mysql database. Whenever a user wants to update the picture they uploaded it through the html form. For some reason my mysql querie on line 67 is not updating … | |
Dear All, I have a text file containing these lines: [QUOTE]12345 12 123 1234 123456 1234567890 123456789032453 1234567890724832445 12345.123456 12345.123 12.12 12[/QUOTE] And I want to read them from c:\numbers.txt and store them into an array and then do some calculations, then save the results in another file(c:\results.txt). I have … | |
hi all i have a problem with file content copying. i have index.php and there are codes in it. i would like to create [COLOR="red"]indexa.php[/COLOR] and append[COLOR="red"] index.php [/COLOR]file contents to newly created [COLOR="red"]indexa.php [/COLOR]file thanks beforehands here is my file [CODE]<?php // This function shows your form function form(){ … | |
Hi, In my asp.net application (an inhouse software) I want users to be able to use files from Network (filepath stored in database). I use the following code to download the files: string strAttachmentID = ((Label)GridViewNotes.Rows[GridViewNotes.SelectedIndex].FindControl("lblAttachmentID")).Text; int AttachmentID = Convert.ToInt32(strAttachmentID); Attachment attachment = Attachment.GetAttachment_ByAttachmentID(AttachmentID); string str = @"\\" + attachment.FilePath; … | |
Hello, I want know how to find some of words in a file. For example : find one word [CODE]if "word" in open(file).read(): print file[/CODE] I wand do that but with 5 words [ word1 , word2 , word3 , word4 , word5 ] If find word1 or word2 or … | |
Country Gold Silver Bronze Total US 9 15 13 37 GE 10 13 7 30 CA 14 7 5 26 NO 9 8 6 23 AU 4 6 6 16 RF 3 5 7 15 KO 6 6 2 14 CH 5 2 4 11 SW 5 2 4 11 … | |
hi, have a slight problem here. this is my open file dialog code. [CODE] private void browseToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "Browse And Upload A Template."; ofd.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"; DialogResult dr = ofd.ShowDialog(); if (dr == DialogResult.OK) { //bitmap … | |
i found this code [URL="http://www.daniweb.com/forums/thread233959.html"]here[/URL] and i tested the code and it isn't working for me this is what my code looks like: [CODE] # PURPOSE: to count the number of words, lines, and characters in a file # # INPUT(S): a file name to be used # # OUTPUT(S): … | |
Hi, My code reads a string from a file. But it misses the lastone. can you help me? 1..Text File [CODE]102.15.12.10 15.14.106.6 1591 1592 bit_torrent[/CODE] 2.. Code [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> struct list_node{ char src_ip[15]; char dst_ip[15]; char src_port[4]; char dst_port[4]; char protocol[15]; }; typedef struct list_node node; … | |
I am trying to read a file into an array and set the min and max values. At this point in my program, I am trying to just read it into an array and then display that array. I still have more to do in the program, but I am … | |
Hello, i want to know the best practice to 1. read an XML file and store it in SQL data base and 2. modify the data base whenever the XML file modified, i created a table on data base on SQL server with columns has the same names like XML … | |
I have to read lines from a text file and reformat them so that the first letter is uppercase and the rest are lowercase. I did that with no problem. also i needed to count the total words in the file, and did that easily.,but i also need to count … | |
hi, I am new to python :). I am having a file say "test.c" test.c file contains test1 test2 test3 test4 and my output should be write in a file as newtest.c... -h test1 -e temp -x temp2 -o temp3 -h test2 -e temp -x temp2 -o temp3 -h test3 … | |
How would I, if it's even possible, create an array to read/store the input values from a input text file? Here is what I was thinking, but I want to pretend as if I don't know the amount of values in the file. Input File Has: 21.22, 13.23, 43.12, 123.54, … | |
Hi I am attempting to write a code that will input the name of a file and output the number of times each letter appears in the file, and it is case-insensitive.For example : a|A : 5 b|B : 3 c|C : 0 d|D : 7 e|E : 0 so … | |
This is something I've been struggling with for a couple months now without having much luck. I beginning to think it's not possible but I'm hoping someone here can prove me wrong. The environment I am working with is a JSP page that interfaces with a java Bean. I want … | |
Hey, I'm having trouble of making my program work. So far I managed it to read the file and display the numbers (just to verify that it is being read right), but I'm not sure if the storing is functioning well, as when I pick another option, well, it doesn't … | |
Hi, I've got a lexer created with flex (under cygwin). Normally I compile it to an .exe file. For the newest project I need a lexer to use in a bigger C# program running on Windows XP. Of course I can execute a file using System.Diagnostics.Process. But it is not … | |
I am writing a c program to copy content of one text file to another but with the copied lines in the destination file preceded by the length of the line and a blank space. Let me illustrate my expectation: original.txt destination.txt daniweb 7 daniweb forum 5 forum plz help … | |
I have one error in my code Error 1 fatal error C1075: end of file found before the left brace '{' at line 50 The program is suppose to ask the user for a filename, read and display the file. Then show 24 lines per screen. I thought I checked … | |
I've learned to write bytes from a file by reading the entire file into a character array and then writing them out to another file using fwrite. Of course, my teacher told me this is both wasteful and a file might not fit into memory, so I should use another … | |
Hi, I am working on a small program that converts English to Morse code and back into English. The input is read from a file specified by the user no matter which way the conversion is going. I figured out the english to morse conversion pretty easily, by just reading … | |
Can anyone please help me exclude the .php files from this code? [CODE] <?php $dir = 'x'; $filecount = 0; $d = dir($dir); while ($f = $d->read()) { if(($f!= ".") && ($f!= "..")) { if(!is_dir($f)) $filecount++; } } echo 'there are ',$filecount,' files in this folder'; ?> [/CODE] I have … | |
I am running windows xp 2002 home edition service pack 2. My problem is when I first open my documents to open a file I can double click on it to open yet when I right click on that file to open with another program it doesn't do anything except … | |
Hi I am using ASP.NET to upload files that is to be stored in MSSQL Server 2008 as varbinary(MAX). I have issues with opening scanned pdf files once users upload them. The issue is happening very randomly (say 20% of the files cannot be opened .). It seems something is … | |
Hi, I want to move a file, when it is created. I have filewatcher and I know filemove function, but I dont know how I can create condition, that the file will be moved, when it is create. Can you help me please? This is my source code: [CODE] #include … | |
I'm trying to open a file (ifstream object), read from the file, then pass the ifstream object to a function where it will continue reading from the file. Along the way, I want to store the path of the file, and would like to know if there is a way … | |
I've tried all manner of methods for accomplishing this and nothing has worked so far. The latest attempt follows. The objective is to call a function that tests for the existence of an image file. If the file exists then that image file is to be displayed. Otherwise, an alternative … | |
Hey guys, ive been working on this code for the past couple of hours and I am trying to do the following problem. Write a program that reads the le generated by randGen.cpp (in Problem 1) and stores the numbers in an array of type int. You can assume that … | |
Im having trouble opening the .txt file in dev-c++, I've entered the correct name for the .txt file which is saved under the same folder, but whenever I compile and run, it will just show : " Begin reading file. End reading file. --------Welcome------- Please choose: etc. " The .txt … | |
Hello, I have a file where the data layout is known. Suppose it's like this: image1 SomeData ... image1000 SomeData ... I want to get an access to the line I want without the necessity to move across all the lines. Let's say I wanna access directly to the line … | |
I'm supposed to output a program that comes out like this: [URL="http://img638.imageshack.us/img638/4135/screen3t.jpg"]http://img638.imageshack.us/img638/4135/screen3t.jpg[/URL] And here is the top part of the code. It is supposed to read a .txt file that has the numbers of the: flight; passengers; and miles; [CODE]int flight, passengers, miles; float income, cost, profit, base, fuel; ifstream … | |
Hello everyone, I have a question regarding advanced file manipulation. I am trying to make a function that will take in a number which will be the number of a record and basically take that record out and display its contents and let the user edit it. Here is the … | |
![]() | Hello! I have small problem. I have char array which contains e.g. "10010010100010110" and I want to read/write it from/to file in binary mode. How can I convert my char array to a group of bits and how to write/read it to/from file? I need something like this: 1. I … ![]() |
Guys, in this program, we have a file by the name of asharray.txt, which is attached to this post, and we have three functions: 1.to read the file 2.to sort the numbers 3.to write to a separate file by the name of( array result.txt) Sp, here I faced some problems, … | |
In my program I am creating a class instance then writing it to a binary file. I do this several times so I have several instances of this class in my file. Then I want to access them individually, read them back into an instance in the program, change its … | |
Let's take this: [CODE]f = open ('myflie.txt', 'w') f.write ('12345');[/CODE] I always get the length of the output printed on the console. Is there any way to prevent it from printing it? | |
Hello guys, this is my first time in these forums, so I apologize for my bad English. Well, here's the problem: I need to get the frequency of integer numbers that are stored in a file, their range is from 0 to 100, their amount is unknown and depends on … | |
Hi people, my first post here, hope its a good one. I am trying to develop a program which will simulate a very simple name server, using the client-server frame. My problem appears after the server receives the data (in form of a string) from the client and tries to … | |
Hello, I am currently trying to create a server/client file transfer system in which the server sends the client .mp3 files. The file transfers fine but when I go to play the file, it is all scratchy and skips and I think it has something to do with the bytes … | |
Aight. I have a query regarding File I/O : [CODE]// Keep reading the file in a loop for some 100 seconds.. for (int x=0; x<100; x++) { // Code for reading file - say readFile() Thread.currentThread().sleep(1000); /* sleep for one second */ }[/CODE] Now, I need to read a file … | |
Hi,am newbie to c programming.can u explain the above c program which reads a file more than its capcity.. i couldn understand more than this.. Thanks,Yasokrish.[code]#include <stdlib.h> #include <stdio.h> #include <string.h> int bof(FILE *badfile) { char buffer[12]; fread(buffer, sizeof(char), 40, badfile); return 1; } int main(int argc, char **argv) { … | |
Hi all, I am new to php. i need file upload and download codes with comments. so please anyone..... | |
So; I have a list in a text file that contains sections of a what would be filenames.. I'm wanting to read from this text file into I guess an array, unless there's a better way to do it.. and then find the file that matches with each of the … | |
We are doing an assignment that reads from a file on the hard drive, asks for user input and then writes it to a different file on the hard drive. We have to use three different functions, besides the main, and cannot use global variables. I cannot seem to get … | |
I am trying to read and write a text file into an array and then store it back into the text file. The main problem i am having is the storing the file character by character into the 3D array. Here is my code: [code] #include <iostream> #include <fstream> using … | |
for starters im just learning C++ so forgive my ignorance... that being said... i need to pull 3 bits of info out of a text file. - Last name (name) - stored as a string - First initial (initial) - stored as a single character - Account balance (account) - … |
The End.