@Don Cragun
I am trying to understand your code and thought I did but after it executes there is no output. I only modified the last line as I thought that was why there was no output, but it appears I was mistaken. I also tried to add the "_" (in bold). Thank you .
/home/cmccabe/Desktop/QC/test/metrics.txt - tab-delimeted, always two lines - this is the file that is copied 3 times and renamed always using lines 3,4,5 of /home/cmccabe/Desktop/QC/analysis.txt
/home/cmccabe/Desktop/QC/analysis.txt
desired output in /home/cmccabe/Desktop/QC/test
Last edited by cmccabe; 03-14-2017 at 10:12 AM..
Reason: added code tags
I'm looking to determine if I can use a grep command to read file and rename the file based on the first 3 characters of the data in the file.
An example is:
Read FileA
If the first 3 positions of the data in the file are "ITP", then rename the file as FileA_ITP, else if the first 3... (3 Replies)
File.jpg
I want to copy and rename this as 2008-12-02.jpg
I tried this copy File.jpg date '%y-%m-%d-%H:%M:%S'.jpg
This doesnt work.... what do i do? (1 Reply)
Hi,
Found lots of stuff that is close but no cigar...
I have a file ie. a.txt, and I want to copy it to another directory 5000 times and call it:
a1.txt
a2.txt
...
a5000.txt
Struggling to put a loop together in this new world of AIX. please include full script for me to understand... (3 Replies)
hi all,
I have one config folder and updates folder.updates folder contains file tmp_2.0_20201208_45.xml and config folder contains file tmp.xml.When the tmp_2.0_20201208_45.xml file is copied in the config folder the name of this file is changed in config folder again as tmp.xml(old... (8 Replies)
Hi All,
I am very new to shell scripting .
In my current task i want to create .sh file that will rename the existing file with appending _bu in it. And then copy new file .
e.g if i have file linuxFirst.java then i want to rename it to linuxFirst_bu.java ..Then want replace with latest... (1 Reply)
Hello,
I've been searching and reading, but I can't figure out how to solve this problem with my newbie skills.
In my directory, I have a list of files (see dirlist.txt attachment) that I need to merge and rename. I have part of the code of the code figured out (see below). However, I... (3 Replies)
Hi Guys,
I have the following problem. I have original file (org.txt) that looks like this
module v_1(.....)
//arbitrary number of text lines
endmodule
module v_2(....)
//arbitrary number of text lines
endmodule
module v_3(...)
//arbitrary number of text lines
endmodule
module... (6 Replies)
Hi All,
My requirement is as follows:
A file (say abc) will be having list of the .txt file names. I need to read this abc file line by line and rename the .txt file names inside it and move them to other folder/path.
Eg:
abc
-------
file1.txt
file2.txt
file3.txt
Output (should... (1 Reply)
I have bunch of files in my source folder like below and every day based on date I am receiving file ex: Nov 28,Nov 29,Nov 30 ...
-rw-rw-r--+ 1 root root 20 Nov 27 06:00 aaaa27.txt
-rw-rw-r--+ 1 root root 20 Nov 28 06:00 aaaa28.txt
-rw-rw-r--+ 1 root root 20 Nov 29 06:00 aaaa29.txt
I... (4 Replies)
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT FREEBSD
pbmtext
pbmtext(1) General Commands Manual pbmtext(1)NAME
pbmtext - render text into a bitmap
SYNOPSIS
pbmtext [-font fontfile] [-builtin fontname] [-space pixels] [-lspace pixels] [text]
DESCRIPTION
Takes the specified text, either a single line from the command line or multiple lines from standard input, and renders it into a bitmap.
In the bitmap, each line of input is a line of output. Formatting characters such as newline have no effect on the formatting; like any
unprintable character, they turn into spaces.
The bitmap is just wide enough for the longest line of text, plus margins, and just high enough to contain the lines of text, plus margins.
The left and right margins are twice the width of the widest character in the font; the top and bottom margins are the height of the
tallest character in the font. But if the text is only one line, all the margins are half of this.
OPTIONS -font,-builtin
By default, pbmtext uses a built-in font called bdf (about a 10 point Times-Roman font). You can use a fixed width font by specify-
ing -builtin fixed.
You can also specify your own font with the -font flag. The fontfile is either a BDF file from the X window system or a PBM file.
If the fontfile is a PBM file, it is created in a very specific way. In your window system of choice, display the following text in
the desired (fixed-width) font:
M ",/^_[`jpqy| M
/ !"#$%&'()*+ /
< ,-./01234567 <
> 89:;<=>?@ABC >
@ DEFGHIJKLMNO @
_ PQRSTUVWXYZ[ _
{ ]^_`abcdefg {
} hijklmnopqrs }
~ tuvwxyz{|}~ ~
M ",/^_[`jpqy| M
Do a screen grab or window dump of that text, using for instance xwd, xgrabsc, or screendump. Convert the result into a pbm file.
If necessary, use pnmcut to remove everything except the text. Finally, run it through pnmcrop to make sure the edges are right up
against the text. pbmtext can figure out the sizes and spacings from that.
-space pixels
Add pixels pixels of space between characters. This is in addition to whatever space surrounding characters is built into the font,
which is usually enough to produce a reasonable string of text.
pixels may be negative to crowd text together, but the author has not put much thought or testing into how this works in every pos-
sible case, so it might cause disastrous results.
-B -lspace pixels
Add pixels pixels of space between lines. This is in addition to whatever space above and below characters is built into the font,
which is usually enough to produce a reasonable line spacing.
pixels must be a whole number.
pixels may be negative to crowd lines together, but the author has not put much thought or testing into how this works in every pos-
sible case, so it might cause disastrous results.
USAGE
Often, you want to place text over another image. One way to do this is with ppmlabel. ppmlabel does not give you the font options that
pbmtext does, though.
Another way is to use pbmtext to create an image containing the text, then use pnmcomp to overlay the text image onto your base image. To
make only the text (and not the entire rectangle containing it) cover the base image, you will need to give pnmcomp a mask, via its -alpha
option. You can just use the text image itself as the mask, as long as you also specify the -invert option to pnmcomp.
If you want to overlay colored text instead of black, just use ppmchange to change all black pixels to the color of your choice before
overlaying the text image. But still use the original black and white image for the alpha mask.
If you want the text at an angle, use pnmrotate on the text image (and alpha mask) before overlaying.
SEE ALSO pnmcut(1), pnmcrop(1), pnmcomp(1), ppmchange(1), pnmrotate(1), pbmtextps(1), ppmlabel(1), pbm(5)AUTHOR
Copyright (C) 1993 by Jef Poskanzer and George Phillips
28 January 2001 pbmtext(1)