6,015 Topics

Member Avatar for
Member Avatar for JaredB

I hope this is the right forum to put this. I'm currently working on a project for school in which we need to read information from a file and then store it into an array of an object we create. The file is just a simple .txt file full of …

Member Avatar for ayan2587
0
78
Member Avatar for K!nKy

Hey everyone, so I am having a really annoying problem with my code. The goal of it is to be able to read a text file of an unknown length (it's more or less a class roster w/ scores) and calculate and display the average of each student. The code …

Member Avatar for K!nKy
0
968
Member Avatar for Loner7

I'm working on a University assignment at the moment (a final assignment). I've normally been able to figure things out, but the teacher's thrown us a curve ball by making us use <fstream>. We've only had one lecture on it which covered [I]outputting[/I] a file, but nothing really handling taking …

Member Avatar for UberJoker
0
113
Member Avatar for Gribouillis

This snippet defines a function [b]chmod[/b] which uses symbolic strings to represent the mode (eg [b]u+rwx[/b]) like the shell command 'chmod'.

0
509
Member Avatar for veggiecook

I foolishly installed Windows xp pro service pack2. It created a loop on startup because the Fasttrak 100TX2 controller driver installed is incompatible with service pack 2. Since I could not restore the operating system in safe mode I tried to reinstall Windows xp pro. I get the following error …

Member Avatar for tomtina
0
434
Member Avatar for sri_sssitc

Someone is building an application for me in VB.NET. I want to be able to check out their work. I want a way to fill up the form, by drawing values from a text file that contains sample values, as soon as I click a button (outside the application window). …

0
53
Member Avatar for Elvedon

I have written two scripts in python. When I run the two scripts as individual programs they run correctly. But when the second script is run as a module within the first by importing it, an image file is not recognised. I have tried calling the full pathwayof the image …

Member Avatar for vegaseat
0
153
Member Avatar for adraganov

Hi, guys. I've been reading your forum for some time. Now I need a little help again. I am trying to read a bitmap file using BITMAPFILEHEADER, BITMAPINFOHEADER and RGBQUAD in windows.h - I need RGB values or only one of them. All the info in header structures is OK. …

Member Avatar for adraganov
0
267
Member Avatar for BobRoss

Sorry, the thread title should read "File paths with spaces" Hello everyone. I am finalizing this little shift cipher program that reads a plain text file line by line, encrypts it, and writes it to a cipher text file. I'm just having difficulty when a user enters file paths with …

Member Avatar for jonsca
0
111
Member Avatar for samarth

Hi, I have the following piece of code. I do the following here 1)open a file. 2) Print the filepointer positon . I get 0 3)Read the file in a while loop till i reach the end 4)close the file 5)Open the same file 6) Print the file pointer position …

Member Avatar for gastonci
0
272
Member Avatar for smurfh

I am attempting to write a vb.net 2008 application that will allow me to send files from a server to a client based on a request. I am going to post the same console application code below. When i run the server and the client on the local machine, i …

Member Avatar for smurfh
0
344
Member Avatar for baskar007

I have a list of part files (that is many parts of single file). I want to append all parts into a single file to make a full file. I used this code: [CODE] import os l = ["home/baskar/1.part","home/baskar/2.part","home/baskar/3.part"] source_file ="/home/baskar/source.file" re_size = 0 buffer = 10*1024 #10 KiB's for …

Member Avatar for Archenemie
0
187
Member Avatar for jko2326

[CODE] // imports import java.io.*; // Input stream import java.util.*; // Date //import java.text.*; // SimpleDateFormat class FinalPrep { //** arrays for saving static String firstNameArray[] = new String[0]; static String lastNameArray[] = new String[0]; static float gradeArray[] = {}; public static void main(String args[]){ readInFile(); System.out.println(" Sorted By last …

Member Avatar for Ezzaral
0
101
Member Avatar for jko2326

I have a file that goes with a java program, and when the program executes its prints out whats in the data file. But when i try to view the file itself It shows some of the names in the file, and all these weird symbols. How can I view …

Member Avatar for BestJewSinceJC
0
85
Member Avatar for sree2

bobsced0$ gcc -g -o prog ss.c bobsced0$ ./prog File size is:906984 Segmentation fault bobsced0$ gdb prog GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO …

Member Avatar for dkalita
0
236
Member Avatar for Darth Vader

I have two processes where the First process sometimes is writing to a file and the second process is reading this file. For the second process I wonder if it is possible to only read the file if the First process does not use the file. How would it be …

Member Avatar for Darth Vader
0
147
Member Avatar for indoreankita

i want to give an option like 'Import' where on clicking on this word , a window should open from where i can choose file and and then can use that file on my page. i can do this by giving an input text box with type file but i …

0
51
Member Avatar for Clinton Portis

Unfortunately in c++, there is really no good way go locate lines in your file without reading the entire file 'character at a time.' So, if you [I]have[/I] to read only a single line from a file, we know we are at some point going to have to be inefficient... …

Member Avatar for Clinton Portis
2
2K
Member Avatar for Samyx

I wanna extract the data from the file so I can sort it out, add and delete files. How can I do it? My file contains a list of songs with the song name, artist and song duration. Here is what I have so far: [code] //Nathaly Advincula //Song Assignment …

Member Avatar for Samyx
0
175
Member Avatar for Mattpd

My file contains: [CODE] Hook,Mark,In, , ,Tire,Matt,Out,01/01/2001,Mike [/CODE] My structure: [CODE] struct part { char name [NAME_LEN+1]; char owner [OWNER_LEN+1]; char status [STATUS_LEN+1]; char date [DATE_LEN+1]; char renter [RENTER_LEN+1]; } parts [MAX_PARTS], temp [1]; [/CODE] And the code: [CODE] FILE *fp; fp=fopen("parts.csv","r"); printf("%d", fp); //Added this for debugging char buf[100]; …

Member Avatar for Mattpd
0
396
Member Avatar for NitaB

Hey guys! I guess my other post wasn't so clear...probably because I wasn't sure what exactly I was trying to do. Anyway, right now I am having problems reading my input file into my 20x20 2D array. I mean, it compiles fine. But, I have a print function just to …

Member Avatar for NitaB
0
174
Member Avatar for natureG

Hello, I am having a problem. The task I have been given is to implement a queue using a linked list. One of the functions of the program is it accept input from the user and write this to a file. The program, thus far, accepts the information, but prints …

Member Avatar for meghana8818
0
882
Member Avatar for gispe

Hi!! im doin a proyect that have to create a library, n create, delete an modificate books to the library. im using a listview to show all the books that r created, n should delete books that i deleted n if a modify one, should delete it n then upload …

0
111
Member Avatar for plastic
Member Avatar for ddanbe
0
212
Member Avatar for hanntaa

Hey guys iv got this project to make an address book that has all kinds of functions and iv got them all working apart from one bit, it needs to be able to read a file when it opens as well as import other data from other files. The data …

Member Avatar for hanntaa
0
212
Member Avatar for LisaJane

I have this program that is supposed to read part numbers from a text file. 101-110, 301-310, 501-510 and put them into a hash table. It will prompt for one of four algorithms to be used and then continue to load the part numbers. Everything seems to be working okay, …

Member Avatar for xaveri
0
5K
Member Avatar for love_dude1984

hi im trying to upload a file with the help of fileupload control. im using following code to save the file in to the database [code] upPic.SaveAs(Server.MapPath("Images/") + txtPrdId.Text.Trim() + ".jpg");//System.IO.Path.GetExtension(upPic.PostedFile.FileName)); [/code] the file gets saved perfectly..but when i try to display the same image somewher else, it shows a …

Member Avatar for Sals
0
133
Member Avatar for furblender

Completely frustrating - I have been googling for a solution for this for a couple of hours now. I have this little bit of code that I wish to read a text file into a Python Dictionary. I used this dictionary format internally within the another piece of code I …

Member Avatar for furblender
0
3K
Member Avatar for cousinoer5

This program has been bugging me a lot to get working, so far I've had to fight through tons of errors Hydra style (every one I got rid of, 2 took its place). Then I finally got an error free compile, but the txt file where the answers should be …

Member Avatar for cousinoer5
0
178
Member Avatar for mindgames

Hi, Is it possible to preserve or retrieve the date of creation of a text file that has been, say, downloaded from an email attachment? I know some types of files have a format-dependent timestamp which is independent of file attributes, i guess (if i'm not wrong) my question boils …

0
75
Member Avatar for tabooxchanz

Fellow Java Coders, I recently got a project to do for my coursework in university which requires that me and my group members simulate a file manager similar to windows explorer but I guess not as complex. Here is a synopsis of what is required: The members of this group …

0
62
Member Avatar for mksakeesh

Hi, I have an text file "CD details" with content as below 1~ Cast Away~ English~ Thriller~ U~ 2~ Titanic~ English~ Romance~ A~ 3~ Forest Gump~ English~ Life~ U~ I am trying to add some additional data to the start of each line by using a code as below [code] …

Member Avatar for mksakeesh
0
101
Member Avatar for _dragonwolf_

I have file with a list of names in it and next to the names is a series of digits. The digits represent its level of popularity per every 10 years. The program I have asks the user to input the file path, then it asks for the user to …

Member Avatar for kvprajapati
0
163
Member Avatar for Jalwes

Could anyone tell me why this code read an extra line? It duplicates some of the last line, only it changes the number. For example, the text file (set up as an inventory file) reads: 45 car 23 bus 1 truck 4 van After running the program, it displays that, …

Member Avatar for Lerner
0
98
Member Avatar for abbz375

Hi everyone, I'm new to this forum and it has helped me a lot with the project I am currently working on. Using VS2008 and created an MFC dialog based application. I just started learning C++ and am finding it difficult to solve this problem. What I'm trying to do …

Member Avatar for abbz375
0
2K
Member Avatar for Clinton Portis

A lot of people have questions about how to load a text file using file I/O. There seems to be 2 popular methods to loading a text file: Use fstream's >> extraction operator. Simple enough, load the file directly into individual containers, word at a time, but you lose your …

Member Avatar for mrnutty
1
195
Member Avatar for neel_patric

hello, i am a little confused with something. im reading values from a text file which only contains 1's and 0's. here is the code. [CODE] char y; ifstream inFile2; inFile2.open("c:\\binary.txt"); ofstream fileout2; while (inFile2 >> y) { //cout<<y<<" "; this would print either a 1 or 0 // based …

Member Avatar for J.Turnbull
0
85
Member Avatar for atuleshchand

Hi Fiends, Does anyone have any idea of how to upload a ZIP file or any other file and perform some string manipulation on that file and return the new file for downloading through JSP on Jakarta Tomcat server. Thanks Atul

Member Avatar for peter_budo
0
40
Member Avatar for jimmiller96

I'm not really sure which forum this belongs in, but please bear with me as I try to explain what I am looking to do. I have a PHP web site designed to display status updates from several dozen computers around the world. Up until now an administrator updates a …

Member Avatar for kireol
0
169
Member Avatar for neithan

Hi everyone, i have this portion of code [CODE=c]while(c = getc(file) != EOF)[/CODE] c is an int and file is a FILE *file = fopen(filename, "r"); The filename points to a file with 2 lines, 10 characters total. That while always makes c a value of 1 (accodring to ASCII …

Member Avatar for neithan
0
99
Member Avatar for pizte

Hello, I'm having trouble making a little parser for the eix program (a gentoo portage search tool) I need to delete (or not write) the last lines of the output (overlays and total packages), they will start always like '[n]' where n is the number of the overlay and the …

Member Avatar for pizte
0
149
Member Avatar for ankit_the_hawk

Hello every1 I was making this program of a phone directory to store contacts and all their information in C. I made use of structure and then copied the data of the structure to a file. the structure is [code] struct phdata { char name[20],add[20]; int phno; }ph[20]; [/code] the …

Member Avatar for aqtel003
0
220
Member Avatar for crazyboy

hi friends ... i want help regarding file management in windows. what i want to do is , Keep track of all files and folders created or deleted during a period of time. for example , during 5 to 6 pm somebudy else is using my computer. so at that …

Member Avatar for crazyboy
0
196
Member Avatar for nunchuckie

Hi, I've just started with c++ and I have no clue how to do this. Right now I have a code that just printing out the text lines in my file and how many lines there is just to check that i can read from my file... But what I …

Member Avatar for rahul8590
0
137
Member Avatar for sanjay092

Hello Every Body I am back, this time I am facing same problem. according to the formula given by DdoubleD i resolve DSS audio file duration problem, but this time some dss file is more compressed and duration of these file different according to size of file. [B]IS there is …

Member Avatar for caveatashish
0
119
Member Avatar for gunjannigam

I have a file which is already written till some lines. I have a blank line at the start of the file and I want to write in that line using Java. I thought creating a FileWriter object by using FileWriter(filename, true) and then a BufferedWriter object will start writing …

Member Avatar for javaAddict
0
104
Member Avatar for dmcadidas15

I'm trying to write a program that will open a file named "data.dat". This file contains an unknown number of values that I need to have read and averaged together and is written such that each line has one value. I need to have the data in this file be …

Member Avatar for pythopian
0
109
Member Avatar for eman neercs

Running php/mysql site where the db is constantly being changed with new products added, categories and prices changed all through php scipts. Just before it publishes the results to a static html file, there is a (my)sql file with product data that has been held "off table" so it cannot …

Member Avatar for chrishea
0
112
Member Avatar for Joe Hart

I have a text file I am trying to manipulate, but the code is very long. I know there is an easy way to do this by looping a few functiions. My code is below but it is not complete. I also have attached one of the text files. There …

Member Avatar for woooee
0
83
Member Avatar for dmitriylm

Hey guys (and girls), I'm trying to write a program that will read a simple text file and output a file with the same contents with the addition of line numbers. This is what I have so far: [code] #include<iostream> #include<iomanip> #include<fstream> using namespace std; int main() { char filename1[20],filename2[20], …

Member Avatar for vmanes
1
104

The End.