Sponsored Content
Full Discussion: Save output in text C++
Top Forums Programming Save output in text C++ Post 302833313 by siya@ on Tuesday 16th of July 2013 08:58:31 PM
Old 07-16-2013
Save output in text C++

Hi ,
i want to save the output of my c ++ code to a text file which is in a particular path :
this is part of my code and I dunno where I am doing it wrong

Code:
do
    {
        for( int i = 0; i < l; ++i  )
        {
            std::cout << 1 + k * i + index[i] << ' ';
        }
		        std::cout << std::endl;
    }
    while( next_index( index.begin(), index.end(), M ) );
std::ofstream out("C:project5\part2\out.txt");
	freopen("out.txt","w",stdout);
    cout<<"write in file";
}

please do advise on my error
thanks
 

10 More Discussions You Might Find Interesting

1. Solaris

terminal output - save to file?

I have a window open on my ultra 10 - a terminal window connecting to a server. Is there any way I can log all output to this window to a log file on my ultra 10 ? (2 Replies)
Discussion started by: frustrated1
2 Replies

2. UNIX for Dummies Questions & Answers

Save TCL Procedure Output

Hello Friend, In TCL i wrote a procedure as power, accepting two arguments and it was saved as a file named TCLProc.tcl. Now from unix, using shell script i want to run this procedure power,the output of this procedure should be saved in a text file.How can i do this.Please help me as early... (1 Reply)
Discussion started by: gjsaravanan
1 Replies

3. AIX

topas -P save output

hi i have server monitor script which totally depends upon the output of TOP which works fine on HP. now i am told to put same script on aix i found that topas -P produces same output but it doesnt redirect output to file i have to kill/terminate it. is there any other way to this. as the... (0 Replies)
Discussion started by: zedex
0 Replies

4. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

5. Shell Programming and Scripting

Save cURL verbose output to file or do it like browser "save as.."

hi there ! i have exactly the same problem like this guy here https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html i am not able to save the curl verbose output.. the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies

6. Shell Programming and Scripting

Save output in a variable

Hi, I have a 3rd party tool on Solaris 8. I am running it thorugh my script but I am not able to capture its output into a variable. Like, I tried, but did not work. output=`/usr/bin/myTool` echo $output Also, I tried saving in a file but when I run, output is always shown on the... (19 Replies)
Discussion started by: angshuman_ag
19 Replies

7. Shell Programming and Scripting

how can save output?

I make shell script by use "if" statement, what should add it to shell script save which I enter it in output file txt? ---------- Post updated at 08:27 AM ---------- Previous update was at 05:59 AM ---------- I mean like this echo "enter your name" read name # now i when start... (1 Reply)
Discussion started by: Oman_Member
1 Replies

8. Shell Programming and Scripting

How to save the 'nmon' output to a text file with a script?

Hi all, I want to do an Unix Script to save the 'nmon' output on a text file and I don't know how to do it. I need a Script for each monitoring and also one to multiple monitorings. Thanks (6 Replies)
Discussion started by: Javi1990
6 Replies

9. Shell Programming and Scripting

Save value from output of Corestat and save in a list for each core

I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below: Core Utilization CoreId %Usr %Sys %Total ------ ----- ----- ------ 5 4.91 0.01 4.92 6 0.06 ... (0 Replies)
Discussion started by: Zam_1234
0 Replies

10. Shell Programming and Scripting

Run sql query in shell script and output data save as delimited text

I want to run sql query in shell script and output data save as delimited text (delimited text would be comma) Code: SPOOL_FILE=/pgedw/dan.txt SQL=/pgedw/dan.sql sqlplus -s username/password@myhost:port/servicename <<EOF set head on set COLSEP , set linesize 32767 SET TRIMSPOOL ON SET... (8 Replies)
Discussion started by: Jaganjag
8 Replies
wnnotow(1)							   User Commands							wnnotow(1)

NAME
wnnotow - User dictionary converter SYNOPSIS
/usr/bin/wnnotow [-i input_file] [-f format_file] [-o output_file] [-l log_file] [-h frequency_value] DESCRIPTION
wnnotow converts a text dictionary created with another Japanese input system (ATOK7, ATOK8, cs00,EGBRIDGE, VJE-Delta) to the Wnn6 text dictionary format. OPTIONS
The following options are available. -i input_file Specifies the name of the dictionary text to be converted. The text code must be EUC. The standard input is read if this option is omitted. -f format_file Specifies the name of the file defining the format used in the input file. The text code must be EUC. The format files cor- responding to each FEP are as follows. Directory: /usr/lib/locale/ja/wnn/ja/otow.format/ Files: atok7-wnn6.fmt (ATOK7) atok8-wnn6.fmt(ATOK8) cs00-wnn6.fmt(cs00) egbridge-wnn6.fmt(EGBRIDGE) vje- wnn6.fmt(VJE-Delta) The ATOK7 format is used if this option is omitted. -o output_file Writes the conversion results in the specified file. The output character code must be Japanese EUC. The output is written to the standard output if this option is omitted. -l log_file Specifies the name of the log file to save error information if unconvertable words are found. The output character code must be Japanese EUC. No log file will be created if this option is omitted. -h frequency_valSpecifies the frequency value to applied for the output file. A frequency value of 1 will be applied if this option is omitted. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWjwncu | +-----------------------------+-----------------------------+ SEE ALSO
wnnatod(1), wnndictutil(1) SunOS 5.10 2 Mar 1998 wnnotow(1)
All times are GMT -4. The time now is 09:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy