You may use clrscr() function insist of system("clear") command.
the "conio.h" file support this function
Otherwise try the "gotoxy" command
gotoxy(), clrscr(), and conio.h are borland turbo C things. This is a UNIX forum, not a DOS one.
If you're printing to a UNIX terminal it should support at least the basic ANSI escape sequences. I've written my own clrscr and gotoxy before which print escape sequences.
---------- Post updated at 09:15 AM ---------- Previous update was at 09:11 AM ----------
Incidentally: since you're using printf already, you should be #including stdio.h, and not iostream. You can use stdio, or iostream, but never both.
Your program will compile perfectly fine in pure C this way too, with no modifications to your program code itself, for you aren't using any C++ functions or syntax anyway.
---------- Post updated at 09:23 AM ---------- Previous update was at 09:15 AM ----------
Another common trick I've seen done to keep printing in the same place is to print a carriage return, not a newline. The cursor will move to the beginning of the line without moving down one line, allowing you to overwrite the same line again and again. You have to keep all your output on the same line this way, but it's dirt-simple.
Last edited by Corona688; 11-19-2010 at 11:26 AM..
Reason: forgot fprintf's parameters, oops
Maybe this question is out there, but I searched and didnt see it.
To print my files I use
more filename | lpr -Pprinter
I would like to print my scripts with line numbers.
How do I do this? (2 Replies)
I've scoured the forum and found similar problems but I can't seem to adapt them to help me with my cause.
This is a two-part question.
I have a multi line file generated by ps | -ef
I need to print out a certain type of pattern. The pattern is part static and part dynamic.
It is a... (3 Replies)
Hi, I'm trying to get awk to print every line ending with a colon along with the next line. I have a file like:
Blah Blah a bunch of words, the money things are as follows:
Spokane 340,087, 000 3.24500% January 23, 2008
does anyone have any advice on this matter? I'm a bit... (6 Replies)
Hello friends,
Only very recently i started learning sed command...an i found that sed is faster in finding the patterns than some of my scripts that uses grep to check the patten inside a file using line by line search method which is time consuming.
The below script... (4 Replies)
Hello,
I am testing some data to get line number at cursor position 9 and found some problem, the code is below.Assume we got 3 attribute. At second attribute, there are some data(eg.A41/A6) missing like at the fourth and six line
11006 A41 1888
11006 ... (7 Replies)
Hi,
I have a file in which the entries are of the following type:
5649 S 1
0412 S 0
0423 S 1
0020 N 0
0020 N 0
1022 S 1
1022 S 1
I need to print the whole line which is having 0 in the third column into a different file
Thanks... (6 Replies)
Help,
I have a text file which looks like
disco 5674536
3456 jambo
disco 453678
4578 jambo
I would like to have an output which looks like below
disco 3456 disco 4578 (4 Replies)
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
LEARN ABOUT MINIX
ppmtosixel
ppmtosixel(1) General Commands Manual ppmtosixel(1)NAME
ppmtosixel - convert a portable pixmap into DEC sixel format
SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile]
DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC
LJ250 color inkjet printer.
If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table
begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file.
OPTIONS -raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com-
pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni-
tude larger than a compressed file and prints much slower.
-margin
If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci-
fied, a 1.5 inch left margin will offset the image.
PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?.
BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was
greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the
color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation.
SEE ALSO ppm(5)AUTHOR
Copyright (C) 1991 by Rick Vinci.
26 April 1991 ppmtosixel(1)