Hi! I don't know if I am even wording this right but here goes. I have to write a programme to read two data files into C++, then ouput as one file in the same format.
The two files are files of 10 bit data. Each 10-bit recorded value is represented by a 16 bit word, of which the top 6...
I am trying to input a txt file into my fortran program. My txt file is a 9x2 table of integers, all I want is to display the values in the same format in my program. I tried using,
program name
implicit none
integer :: input(9,2), I, J
open (unit=20, file="values.txt")
DO I =...
how to see the output of a file operation?
eg void main()
{ int a;
cin>>a;
ofstream o("a.txt");
o<<a;
o.close();
}
does the text file "a" come into existence? can we open it?
Every time i try and copy or rename a file in Eclipse, I get the error
org.tigris.subversion.javahl.ClientException: RA layer request failed svn: Server sent unexpected return value (405 method not allowed) in response to MKACTIVITY request...
help!
Homework Statement
I'm trying to read parameters from a text file (format below) but actually my function didn't receive any parameters from read file function.
Number_of_points 80
Distance 10.0
Time_step 0.05
Velocity 5.0
Diff_coeff 50.0
Homework Equations
The Attempt at a...
Homework Statement
Dear physics forum,
I'm start learning C++ and I'm trying to program a space transform function for linearized convection-diffusion problem using Code:block
Everything was fine until I wrote calculated result into a file. When I run the program, some error message...
Hi all,
do i = 1, 79
open(2,file=afiln(i),status='old')
do k = 1,11
read(2,'(51a)')astr1
enddo
do j=12,2000
read(2,22,end=23,err=23)iyr,imn,id,ih,imt,flx
write(7,*)i,j
obstim =...
Homework Statement
Write a script which plays a Doppler shifted version of a WAV file.
The Attempt at a Solution
This is the code for a doppler shifted single frequency:
vs = 1100; % speed of sound in feet per second
v0 = s*22/15; % speed of the vehicle in feet per second
fs = 10000; %...
clc
for ii=1:1:3 % start looping
rand_id= rand(1,1) *3; % Randomly generte a number between 1 to 3.if (rand_id<1)
rand_id=1; % 0 is ommitted.
else rand_id=floor(rand_id);
end
% rand_id will be used to open a previously saved file randomly.
if (rand_id==1)...
Hi. You may only understand what I am going on about here if you play an instrument.
I have often noticed that there are songs that I really love and know inside out, which, in my mind, I can play almost perfectly in my head; most of the parts and certainly all of the melodies etc.
But...
Hey,
so i want to write a string to a .txt file and I tried by doing this:
save filename.txt writer
(where writer is the variable containing string)
...
But i get weird char. instead of the string.
Any ideas?
Hi,
I've got a program which recalls strings randomly from a file. The file contains the strings, with each one taking up 200 bytes and if it's not long enough, I have spaces inserted after to make up the length. So they are all end to end, and there are no line breaks.
The program works...
Hi,
Looking for a bit of cheeky help with matlab, I am stumped!
1) I have written a program that i want to cycle through different sets of data, ideally this is what i would like:
These are all xls files with columns of data
ydata = ...
xdata = ...
zdata = ...
for variable =...
I have a short code that calculates the running median for three columns of data in an input file and writes the running medians out to three columns of data in an output file. I use Numerical Recipe subroutines and functions to compute the running median. If I include a WRITE(*,*) directly...
C program help!
Hey guys I am having trouble completing this C program. Its suppose to ask the user to enter a file to read from, read the file, count how many times each word appears and print the results in a different file(also user input) arranged from high occurrence.
Heres what i...
Hey,
I'm modeling the criticality of a core for a university project using MCNP4C. I've run the core on the appropriate KCODE parameters, specifying the source using the KSRC card, and I was looking to cut down on the computing time using the SRCTP files.
My problem is that I can't find...
I finally got a decent color camera for my lab, and would like to share some images here. I can't find any forum guidelines for the images- specifically, what's the allowed filesize?
Hi,
I'm trying to write a simple program that reads the content of a textfile and removes all hyphen by replacing them with ' '
#include <stdio.h>
#include <stdlib.h>
int main(){
FILE *fp = fopen("Thetextfile.txt","r+") /* Open for reading and writing */
char ch;
while(ch =...
it prints fine for the first generation, but nothing else after that. i am thinking that my problem lies in the cellStatus function and its implementation within the printCell function. attached are the files that i am getting input from and the file that i am printing to.
#include...
Hey all,
I'm in the process of writing a Suggested Reorder Program for my father's small business..
His current computer program exports its item data in the form of .CSV files. I'm trying to read the file into FORTRAN to manipulate. However, I run into the following problem:
Even...
I am pretty ignorant of this language. I am working from a '...for dummies' book to teach myself and after the first few pages I have already stumbled upon a problem. I have attached a code, pretty simple one, which I'm trying to run but there are some errors and I don't know how to resolve...
I've tried to open several different .exe files, and keep getting the same error. I've gone to several Windows help/ troubleshooting sites to no avail. My OS is Windows XP SP3 and browser is Firefox Ver. 3.5.9. I'm not able to install any other browsers on my system to test if this is Firefox...
i am trying to locate the end of a text file and delete any extra white spaces following it, but i am having trouble trying to do this. is there an easy way to do this? right now i am reading the text in character by character and outputting the text to another outstream file. i can't seem to...
Hi,
I want to redirect output of mc6811 from terminal to a file.I have tried google search and did not find any solution for that.Can anyone help me?I appreciate your help.
Thanks
Rose
Hello,
In my computational science class I have the task of taking the following input file and manipulating it.
I have the following input file:
C1 0 0.00 0 000.0 0 000.0
O2 1 1.22 0 000.0 0 000.0
H3 1 1.09 2 120.0 0 000.0
C4 1 1.54 2 120.0 3 180.0
H5 4 1.09 1 110.0 2...
I have a small problem that I would like to solve. I have an idea, but it's kind of half-assed and I'm not sure if there's a better way.
The problem: I have a CFD solution that writes out a solution file everything 5 minutes or so. I currently am writing out 32 total solution files. So, when...
system?
I know that it isn't possible in Windows since Windows has the registry and background variables that aren't stored on the file system for some reason.
But what about Linux? Are its environment variables stored on the file system? Is there anything that isn't stored on the file...
extract data from a "huge" file using matlab
hi guys,
I need some help!
I have a file(.txt) which concludes about 20,000 lines. There are not only number data but also letters and different characters in the file. I want to extract some certain useful data from this file and put them into a...
How to open a file with a name that is not defined in advance, but
is entered after the program is executed?
I am using fopen function, but it seems that it's argument must be
a fixed string, not a variable.
What I want to do is to to read the number of processes, their arrival time, and then in the next line, their bursts. Here's the file format:
P1 0
12 2 21 2 12 32 18
P2 9
13 17 3 21 45 67 21 2
(1st line) Process Arrivaltime
(2nd line) Bursts
(3rd line) Process Arrivaltime
(4th line)...
Homework Statement
I want to read each line separately in a char array from a text file. As yet, the best I could do is to read the entire file in a single char array. How can I read each line in a separate array?
Homework Equations
The Attempt at a Solution
#include <stdio.h>...
i am writing a MATLAB m file.
i need to generate a NxN matrix 25% filled with 0s and 1s in a random pattern...
is this at all possible?
also, in an NxN matrix, i need to select a 3x3 matrix centered around a certain point, can you help me out with this?
many thanks for your help
clc
clear
f = input('Enter the force applied in lbs: ');
p_c = input('Enter point closest to pivot: ');
p_f = input('Enter point farthest from pivot: ');
filename = input('name of file is: ','s');
points = input(' # of points to calculate: ');
x = [p_c;rand(points,1)*p_f-p_c+p_c;p_f]...
This thing is a mess. XP file organization was fine, but since when something works fine, people like to fix it (make it not work anymore), they made something simple into another reason to pull your hair out. I'm trying to put my music files in descending order for duration. I had to add a...
I hope this post goes here, if not I apologize, admin's feel free to move it if needed.
I need a place to store files listed in the title above where I can get link(s) for posting to forums, share with friends, etc... I use tinypic for posting pictures, and that works fine, but I need a...
A text file contains 1000 characters. When the file is sent by email from one machine to another, each character (independent of other characters) has probability 0.001 of being corrupted. Use a poisson random variable to estimate the probability that the file is transferred with no errors...
Hi everyone,
I have a folder of Vietnamese songs (files). The file names are in Vietnamese.
I used a VB6 program to create a list of file names and output them to MS-word.
The program won't understand the Vietnamese characters, suc as ^, ., ~..., so it was represented by question marks...
I'm an occassional Mathematica user (Ver 7.0.1.0).
I'm doing something now where I need to import a couple of large Excel files, no problem with that. I'm wondering, however, if there is a procedure to make the resulting lists created by the imported data permanent so that I don't have to...
Hi,
I found this mathematica packages file and can't use it...
"The "FixedTalbotNumericalLaplaceInversion.m" file should be placed into the AddOns folder on the user's computer"
As written in the file, i need to save this file under AddOns folder. Done with that and yet still couldn't...
I have a bunch of files that I want to find the ones that do not contain a word. I think that I can use grep to do this but I am not sure. does anyone know how to do this?
Matlab: Urgent!
My comp crashed and now I can't open my file anymore...
it gives me this error message:
http://i31.photobucket.com/albums/c374/haoming/matlab2938293.jpg
Please help!
Hello all,
Does anyone know how to open a .pdf file (or a .exe) file from a Visual C++ 2008 express edition program?
What I am trying to do is to have the user enter a number that corresponds to a certain .pdf file and have that .pdf file open for the user to read,save,print, etc ...
I need to look for the presence of '////' in my data file
i could read it as character
since i need to eliminate them from the file,
I've tried to avoid them using
if(xx .eq. '////') then
but is not working the error comes as
if(mt.ne. '////')then...
Hi. I need to write a fortran program that calls an EXE, call it "runner.exe" that in turn runs an input file, call it "run.inp". Thing is, I would normally run "runner.exe" manually, and type in "run.inp" and "runner.exe" gives outputs. But now, I have 100's of input files and I can't affod...
Hello guys,
I have a file with X Y values (separated by space)
I want to scan the data to find the PEAK in the file. (It will probably be a lowest Y point...)
How do I do this is Fortran?
Thank you,
Alexander
Hi,
I have several tex documents that share the same mybibliography.bib file. Each of these tex documents have its own folder and in each folder I'm repeating the mybibliography file. My question is if there is a way to generate all my tex documents using just one bibliography file.
Thanks!