10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a comma separated file. I would like to print every alternate columns into a new row.
Example input file:
Name : John, Age : 30, DOB : 30-Oct-2018
Example output:
Name,Age,DOB
John,30,30-Oct-2018 (3 Replies)
Discussion started by: Lini
3 Replies
2. Shell Programming and Scripting
Hi everyone..
I have a list of values in a file...
a,
b,
c,
1,
2,
3,
aaaa,
bbbbb,
I am interested in converting this column to a row..
"text",aaaa,
bbbb
a,1 (7 Replies)
Discussion started by: manihi
7 Replies
3. Shell Programming and Scripting
Hi,
i have a raw output file like this
167,63.50
167,63.50
168,63.68
166,63.68
168,63.68
I would like to add every each N rows (for example 60) and in a third column , a timestamp using the command date +"%H:%M"how can i do it with one single command ?
Thank you !! (5 Replies)
Discussion started by: Board27
5 Replies
4. UNIX for Dummies Questions & Answers
Hello. Trying to add a column of numbers and combine the 1st and 2nd fields as uniq with the new total.
This works to add the numbers but can't figure an easy was to combine the 1st and 2nd column as the list is very long. awk '{s+=$3} END {print s}'
bird dog 300
bird dog 100
cat clown 200... (1 Reply)
Discussion started by: jimmyf
1 Replies
5. Shell Programming and Scripting
is there another way of doing the below:
echo "7 3 8 2 2 1 3 83.4 8.2 4 8 73 90.5" | bc
shell is bash. os is linux and sunos.
bc seems to have an issue with long range of numbers (12 Replies)
Discussion started by: SkySmart
12 Replies
6. UNIX for Dummies Questions & Answers
I have a text file where I want to append a column of numbers in ascending orders.
Input:
57 abc
25 def
32 ghi
54 jkl
Output:57 abc
57 abc 1
25 def 2
32 ghi 3
54 jkl 4
How do I go about doing that? Thanks! (11 Replies)
Discussion started by: evelibertine
11 Replies
7. UNIX for Dummies Questions & Answers
How do you delete cells from a space delimited text file given row and column number? Letś say the row number is r and the column number is c. Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies
8. Shell Programming and Scripting
Dear all,
Does anyone know how I could to add a column of numbers (1s, or 2s, or..., or 6s) to two-column text files (tab-delimited), where the specific number to be added varies as a function of the file naming?
Currently, each of my text files has two columns, so the column with the... (12 Replies)
Discussion started by: rlapate
12 Replies
9. UNIX for Advanced & Expert Users
Hello, I have a file, and one column has both positive and negative numbers. Does anyone know how I can calculate the total of all the values (i.e, +ve and -ve).
eg:
col1 col2 col3
data 23 data
data 76 data
data -30 data
Thanks
Khoom (1 Reply)
Discussion started by: Khoomfire
1 Replies
10. Shell Programming and Scripting
Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)
Discussion started by: aYankeeFan
9 Replies
ppmlabel(1) General Commands Manual ppmlabel(1)
NAME
ppmlabel - add text to a portable pixmap
SYNOPSIS
ppmlabel [-angle angle] [-background transparent | colour] [-colour colour] [-file filename] [-size textsize] [-text 'text string'] [-x
column] [-y row] ... [ppmfile]
DESCRIPTION
ppmlabel uses the text drawing facilities of ppmdraw to add text to a portable pixmap. The location, size, baseline angle, colour of the
text and background colour (if any) are controlled by command line arguments. The text can be specified on the command line or read from
files. Any number of separate text strings can be added by one invocation of ppmlabel, limited only by the maximum length of the command
line.
If no ppmfile is specified, ppmdraw reads its input pixmap from standard input.
OPTIONS
The arguments on the ppmlabel command line are not options in the strict sense; they are commands which control the placement and appear-
ance of the text being added to the input pixmap. They are executed left to right, and any number of arguments may appear.
All flags can be abbreviated to their shortest unique prefix.
-angle angle
Sets the angle of the baseline of subsequent text. angle is specified as an integral number of degrees, measured counterclock-
wise from the row axis of the pixmap.
-background transparent | colour
If the argument is ``transparent'', text is drawn over the existing pixels in the pixmap. If a colour is given (see the -colour
switch below for information on how to specify colours), rectangles enclosing subsequent text are filled with that colour.
-colour colour
Sets the colour for subsequent text. The colour can be specified in five ways:
o A name, assuming that a pointer to an X11-style colour names file was compiled in.
o An X11-style hexadecimal specifier: rgb:r/g/b, where r g and b are each 1- to 4-digit hexadecimal numbers.
o An X11-style decimal specifier: rgbi:r/g/b, where r g and b are floating point numbers between 0 and 1.
o For backwards compatibility, an old-X11-style hexadecimal number: #rgb, #rrggbb, #rrrgggbbb, or #rrrrggggbbbb.
o For backwards compatibility, a triplet of numbers separated by commas: r,g,b, where r g and b are floating point numbers
between 0 and 1. (This style was added before MIT came up with the similar rgbi style.)
-file filename
Reads text from the file filename and draws it on successive lines.
-size textsize
Sets the height of the tallest characters above the baseline to textsize pixels.
-text 'text string'
Draws the given text string (which must be quoted if it contains spaces). The location for subsequent text is advanced by 1.75
times the current textsize, which allows drawing multiple lines of text in a reasonable manner without specifying the position of
each line.
-x column Sets the column at which subsequent text will be left justified. Depending on the shape of the first character, the actual text
may begin a few pixels to the right of this point.
-y row Sets the row which will form the baseline of subsequent text. Characters with descenders, such as ``y'', will extend below this
line.
BUGS
Text strings are restricted to 7 bit ASCII. The text font used by ppmdraw doesn't include definitions for 8 bit ISO 8859/1 characters.
When drawing multiple lines of text with a non-transparent background, it should probably fill the space between the lines with the back-
ground colour. This is tricky to get right when the text is rotated to a non-orthogonal angle.
The -size, -x, and -y options MUST precede the -text option specifying the string they apply to, or they will be silently ignored in favor
of the defaults.
SEE ALSO
ppmmake(1), ppm(5)
AUTHOR
Copyright (C) 1995 by John Walker (kelvin@fourmilab.ch)
WWW home page: http://www.fourmilab.ch/
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted,
without any conditions or restrictions. This software is provided ``as is'' without express or implied warranty.
14 June 1995 ppmlabel(1)