Hi,
One silly question. I would like to add statement like below and append to a file. I used the below code; however, it does not work. Can anyone please tell me what mistakes I have made?
awk '
{ for (i=1;i<=563;i++)
print i
}'>>output.txt
Thanks.
-Jason (1 Reply)
ive input file contains to clums a and b spreated by pipe
a | b
123|456
323|455
and
xyz contains other info about a and b
now i want to print as follows:
a | b | "info from xyz"
but "info from xyz" might be more than 1 line and i want to keep the format to 3 cloums.
how to do it?... (3 Replies)
I want to print the 1st field in a comma seperated file to lower case and the rest the case they are.
I tried this
nawk -F"," '{print tolower($0)}' OFS="," file
this converts whole line in to lower case i just want the first column to be converted.
The below doesnt work because in... (11 Replies)
Hello all,
this should really be easy for you... I need AWK to print column maxima for each column of such input:
Input:
1 2 3 1
2 1 1 3
2 1 1 2
Output should be:
2 2 3 3
This does the sum, but i need max instead:
{ for(i=1; i<=NF; i++)
sum +=$i }
END {for(i=1; i in sum;... (3 Replies)
Hi, I'm using a while-loop in an awk script. If it matches a regular expression, it prints a line. Unfortunately, each line that is printed in this loop is followed by an extra character, "1".
While-statement extracted from my script:
getline temp;
while (temp ~ /.* x .*/) print temp... (3 Replies)
Hi everyone,
Ok here's the scenario.
I have a control file like this.
component1,file1,file2,file3,file4,file5
component2,file1,file2,file3,file4,file5I want to do a while loop here to read all files for each component.
file_count=2
while ]
do
file_name=`cat list.txt | grep... (2 Replies)
Hi, I have data of the following type,
chr1 234 678 39 852 638 abcd 7895
chr1 526 326 33 887 965 kilj 5849
Now, I would like to have something like this
chr1 234 678 39 852 638 abcd 7895 <a href="http://unix.com/thread=chr1:234-678">Link</a>
chr1 526 326 33 887 965 kilj 5849 <a... (5 Replies)
I was trying to simplify this from what I'm actually doing, but I started getting even more confused so I gave up. Here is the content of my input file:
Academic year,Term,Course name,Period,Last name,Nickname
2012-2013,First Semester,English 12,7th Period,Davis,Lucille
When I do this:
... (3 Replies)
Experts,
i have a following file containing data in following manner.
1 2480434.4 885618.6 0.00 1948.00
40.00 1952.00
... (6 Replies)
Discussion started by: Amit.saini333
6 Replies
LEARN ABOUT REDHAT
pbm2ppa
pnm2ppa(5 Feb 2000) pnm2ppa(5 Feb 2000)
NAME
pbm2ppa - convert portable bitmap (PBM) to HP's Printing Performance Architecture (PPA) file format
SYNOPSIS
pbm2ppa [options] [ <infile] > [ <outfile]> ] ]
DESCRIPTION
Reads portable bitmap (PBM) format as input. Outputs a stream suitable for processing by Hewlett-Packard's range of Printing Performance
Architecture (PPA) printers. pnm2ppa supports the HP 710c, 712c, 720c, 722c, 820c, and 1000c series printers.
(Portable bitmap (PBM) format output can be produced from PostScript(tm) input by the GhostScript driver "pbmraw".)
OPTIONS
infile Input file infile is either a path to a file or device, or '-' to indicate stdin (defaults to stdin)
outfile
Output file outfile is either a path to a file or device, or '-' to indicate stdout (defaults to stdout)
-b bottommargin
Sets the bottom margin bottommargin in units of 1/600 inches (e.g., -b 150 = 0.25")
-d Displays the current configuration
-f configfile
Overrides reading the configuration from /etc/pnm2ppa.conf, and uses configfile instead.
-h Displays program usage
-l leftmargin
Sets the left margin leftmargin in units of 1/600 inches (e.g., -l 150 = 0.25")
-r rightmargin
Sets the right margin rightmargin in units of 1/600 inches (e.g., -r 150 = 0.25")
-s papersize
Sets the paper size. Possible values for papersize are a4 (A4), letter or us (US Letter, 8.5"x11"), and legal (US Legal, 8.5"x14").
The default is US Letter.
-t topmargin
Sets the top margin topmargin in units of 1/600 inches (ie -t 150 = 0.25")
-v printertype
Selects the printer model. Possible values of printertype are: 710, 712, 720, 722, 820 and 1000. The default is the HP DeskJet 7X0
Series (710, 712, 720, 722).
-x xoffset
Sets the x-offset xoffset from the left of the page. Units are 1/600 inches
-y yoffset
Sets the y-offset yoffset from the top of the page. Units are 1/600 inches
NOTES
The configuration file is read in first. Command line arguments then modify the resulting definitions.
The -x and -y options accumulate. The -v option resets all definitions back to an inbuilt default for that printer and should be used
before subsequent -b -l -r, -t, -x, and -y arguments.
SEE ALSO pbm(5)FILES
/etc/pbm2ppa.conf
Default configuration file
AUTHOR
This code is licensed under the GNU Public License version 2. See LICENSE for details.
(c) 1998 Tim Norman
HISTORY
This program was written by Tim Norman. It originally supported black and white output on the 820 series. This program is almost obsolete;
its successor pnm2ppa will support color printing.
BUGS
This is a stable driver, but does not support color printing.
pnm2ppa(5 Feb 2000)