Hi,
Is there some way to get formatted output in ksh? Something like a properly alligned tabular format. I tried adding '\t' to echo statements, but it doesn't come properly alligned
'hello' A simple Hello
'helloworld' A helloworld statement
I need the second coloumn to... (1 Reply)
var=12345
echo $var >>>12345
printf "%8.1f \n" $var >>> 12345.0
How to get this as 12,345?
I suppose I could break into sections by dividing by 1000 or 1000000.
But, is the a trick to this? (4 Replies)
Hi
I have the following records in a file
SABN YOURTUBE 000514 7256
SACN XYOUDSDF 000514 7356
SADN KEHLHRSER 000514 7656
SAEN YOURTUBE 000514 7156
SAFN YOURTUBE 000514 7056
I need to put this in the format like this
printf '%s %-50s %6s %-6s\n'
I am not going to read individual... (3 Replies)
Hi
I have the following lines in a file
SWPRC000001NOT STATED 1344
SWPRC000001NOT STATED 1362
SWPRC000001NOT STATED 1418
SWPRC000001NOT STATED 1436
SWPRC000001NOT STATED ... (6 Replies)
hi, i've searched the forums' entries and have tried some of the examples -- to no avial -- this is my first post -- thanks in advance for your help...
As part of an installation program -- i'm receiving two(2) extraneous "libcxb WARNING!" statements -- i want to use sed to eliminate the... (12 Replies)
Dear All,
Good Day. I would like to hear your suggestions for the following problem:
I have a file with 5 columns with some numbers in 16 lines as shown below.
Input file:
Col 1 Col 2 Col 3 Col 4 Col 5
12 220 2 121 20
234 30 22 9... (3 Replies)
Can you please tell me how to just get only the output of dealers I & V information along with their subtotals in the next line of the file and create a new file, The dealer position along with corresponding totals may change everyday to any position above or below in the file, please help Thanks (2 Replies)
Hi all
I'm having a few issues with sorting some data into easily-readable columns.
Original data in file:
Number of visits IP Address
8 244.44.145.122
8 234.45.165.125
6 225.107.26.10
I firstly tried the column -t command which results in this:
Number of ... (4 Replies)
Hi Techies,
I'm a newbie to PERL, Please help me with following problem.
I have an input text file like below
cat Input.txt
418673132,P
492538858,P
384535478,P
521522357,I
529435679,I
183617024,P
184414408,I
735510689,P
736238343,I
411642045,I
412690979,I
104232783,I (2 Replies)
libcaca-ruby-api(3caca) libcaca libcaca-ruby-api(3caca)NAME
libcaca-ruby-api - Libcaca Ruby API
Classes
The classes available for libcaca are :
o Caca::Canvas : functions that have a caca_canvas_t* as first argument
o Caca::Dither : functions that have a caca_dither_t* as first argument
o Caca::Font : functions that have a caca_font_t* as first argument (The constructor can currently only accept the name of a builtin font)
o Caca::Display
o Caca::Event
o Caca::Event::Key
o Caca::Event::Key::Press
o Caca::Event::Key::Release
o Caca::Event::Mouse
o Caca::Event::Mouse::Press
o Caca::Event::Mouse::Release
o Caca::Event::Mouse::Motion
o Caca::Event::Resize
o Caca::Event::Quit
The character set conversion functions are not available yet in the binding.
$ irb -rcaca
irb(main):001:0> class Object
irb(main):002:1> def Object.my_instance_methods
irb(main):003:2> instance_methods.sort - ancestors[1].instance_methods
irb(main):004:2> end
irb(main):005:1> def Object.my_methods
irb(main):006:2> methods.sort - ancestors[1].methods
irb(main):007:2> end
irb(main):008:1> end
irb(main):009:0> Caca.constants
=> ['BROWN', 'BOLD', 'GREEN', 'LIGHTMAGENTA', 'LIGHTBLUE', 'BLINK',
irb(main):010:0> Caca.my_methods
=> ['version']
irb(main):011:0> Caca::Canvas.my_methods
=> ['export_list', 'import_list']
irb(main):012:0> Caca::Canvas.my_instance_methods
=> ['attr=', 'blit', 'clear', 'create_frame',
irb(main):013:0> Caca::Font.my_methods
=> ['list']
irb(main):014:0> Caca::Font.my_instance_methods
=> ['blocks', 'height', 'width']
irb(main):015:0> Caca::Dither.my_instance_methods
=> ['algorithm=', 'algorithm_list', 'antialias=', 'antialias_list',
irb(main):010:0> Caca::Display.my_instance_methods
=> ['canvas', 'get_event', 'height', 'mouse=', 'mouse_x', 'mouse_y', 'refresh',
irb(main):011:0> Caca::Event.constants
=> ['Key', 'Quit', 'TYPE', 'Mouse', 'Resize']
irb(main):012:0> Caca::Event.my_instance_methods
=> ['quit?']
irb(main):013:0> Caca::Event::Key.my_instance_methods
=> ['ch', 'utf32', 'utf8']
irb(main):014:0> Caca::Event::Mouse.my_instance_methods
=> ['button', 'x', 'y']
irb(main):015:0> Caca::Event::Resize.my_instance_methods
=> ['w', 'h']
Samples
$ ruby -rcaca -e 'c=Caca::Canvas.new(6, 3).fill_box(0,0,2,2,'#'[0]);
c2=Caca::Canvas.new(1,1).put_str(0,0,'x'); c.blit(1,1,c2); puts
c.export_to_memory('irc')'
###
#x#
###
$ ruby -e 'puts Caca::Canvas.new(6,3).draw_thin_polyline([[0,0], [0,2],
[5,2],[0,0]]).export_to_memory('irc')'
-.
| `.
----`-
$ ruby -rcaca -e 'p Caca::Canvas.export_list'
[['caca', 'native libcaca format'], ['ansi', 'ANSI'], ['utf8', 'UTF-8
withANSI escape codes'], ['utf8cr', 'UTF-8 with ANSI escape codes and
MS-DOS
'], ['html', 'HTML'], ['html3', 'backwards-compatible HTML'],
['irc', 'IRC with mIRC colours'], ['ps', 'PostScript document'], ['svg',
$ ruby -rcaca -e 'p Caca::Font.list'
['Monospace9', 'Monospace Bold 12']
require 'caca'
c = Caca::Canvas.new(20,10)
c.put_str(2,3, 'plop!')
c.draw_thin_polyline([[0,0],[0,2], [5,2], [0,0]])
d = Caca::Display.new(c)
d.title= 'Test !'
d.refresh
#Redefine Event::Key#quit? so that q, Q, and Esc become exit keys
module Caca
class Event::Key
def quit?
'qQ^['.split('').member?(@ch.chr)
end
end
end
while((e= d.get_event(Caca::Event, -1)) && ! e.quit?)
p e
d.refresh
end
Version 0.99.beta18 Fri Apr 6 2012 libcaca-ruby-api(3caca)