03-02-2009
Thank you for your valuable inputs. I 'll try the scripts. regards
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i'm new to shell scripting and have a problem please help me
in the script i have a nawk block which has a variable count
nawk{
.
.
.
count=count+1
print count
}
now i want to access the value of the count variable outside the awk block,like..
s=`expr count / m`
(m is... (5 Replies)
Discussion started by: saniya
5 Replies
2. Shell Programming and Scripting
HI guys,
I have created a script to read 1 column in a csv file and then place it in text file.
However, when i checked out the text file, it is not in a column format...
Example:
CSV file contains
name,age
aa,11
bb,22
cc,33
After using awk to get first column
TXT file... (1 Reply)
Discussion started by: mdap
1 Replies
3. Shell Programming and Scripting
Hi All,
I have the following file that has computer data for various pcs in my network...
Snap of the file is as follows
*******************************************************************************
Serial
123456
Computer IP Address
lo0:... (1 Reply)
Discussion started by: aavam
1 Replies
4. Shell Programming and Scripting
Hi All,
I have an xml file with the below format.
<a>111</a><b>222</b><c>333<c><d><e>123</e><f>234</f><d><e>456</e><f>789</f>
output needed is
111,222,333,123,234
111,222,333,456,789
nawk 'BEGIN{FS="<|>"}
{print a,b,c,e,f
a=""
... (7 Replies)
Discussion started by: natalie23
7 Replies
5. Shell Programming and Scripting
I have a file tmp.txt as shown below:
Controller: 0
Disk: 0.0.0
Disk: 0.1.0
Disk: 0.2.0
Controller: 1
Volume:c1t2d0
Disk: 0.0.0
Disk: 0.1.0
Disk: 0.2.0
Controller: 2
Volume:c2t2d0
Disk: 0.2.0
Now I want to split... (4 Replies)
Discussion started by: durbam2002
4 Replies
6. Shell Programming and Scripting
Hi! I have a file which I want to search daily for any line that contains the work 'Reason' and I want to take that line and put the data in a certain format using awk or nawk....I do not have gawk on my machine so it would have to be awk or nawk, or sed would work as well. Here are some examples... (9 Replies)
Discussion started by: ther2000
9 Replies
7. Shell Programming and Scripting
Hi all,
I try to make a awk-script, which counts lines, summarized by pdf and xml.
So far it works, but for sorting reasons, I'd like to change the format from the field $1 from dd-mm-yyyy to yyyy-mm-dd.
This works find, but: split() and sprintf() prints its output (for no reason, the results... (2 Replies)
Discussion started by: regisl67
2 Replies
8. Shell Programming and Scripting
Looking for some help and usually when I do a search this site comes up. Hopefully someone can give me a little direction as to how to use one of these two commands to achieve what I'm trying to do.
What am I trying to do?
I need to take the time value in epoch format returned from the... (5 Replies)
Discussion started by: minigts
5 Replies
9. Shell Programming and Scripting
Hi, Guys,
There is one question about AWK format. Here is the code:
gawk -F: '/^Dan/ {print "Dan's phone number is ",$2}' lab3.data
An syntax error will come out because the quote mark between Dan and s and first quote mark are recognized as a quote pair.
I want to get the input like this:... (5 Replies)
Discussion started by: franksunnn
5 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have a file where I need to change the date format on the nth field from DD-MM-YYYY to YYYY-MM-DD so I can accurately sort the record by dates
From regex - Use sed or awk to fix date format - Stack Overflow, I found an example using nawk.
Test run as below:
$: cat xyz.txt
A ... (2 Replies)
Discussion started by: newbie_01
2 Replies
LEARN ABOUT REDHAT
pamstack
pamstack(1) General Commands Manual pamstack(1)
NAME
pamstack - stack planes of multiple PAM images into one PAM image
SYNOPSIS
pamstack [-tupletype tupletype] [inputfilespec]
All options may be abbreviated to the shortest unique prefix.
DESCRIPTION
Reads multiple PAM or PNM images as input. Produces a PAM image as output, consisting of all the planes (channels) of the inputs, stacked
in the order specified.
The output is the same dimensions as the inputs, except that the depth is the sum of the depths of the inputs. It has the same maxval.
pamstack fails if the inputs are not all the same width, height, and maxval. The tuple type is a null string unless you specify the -tuple-
type option.
pamchannel does the opposite of pamstack: It extracts individual planes from a single PAM.
Use pamtopnm to convert a suitable PAM image to a more traditional PNM (PBM, PGM, or PPM) image.
One example of using pamstack is that some Netpbm programs accept as input a PAM that represents graphic image with transparency informa-
tion -- tuple type "RGBA". In Netpbm, such images were traditionally represented as two images - a PPM for the color and a PGM for the
transparency. To convert a PPM/PGM pair into PAM(RGBA) input that newer programs require, do something like this:
pamstack -tupletype=RGBA myimage.ppm myalpha.pgm | pamtouil >myimage.uil
OPTIONS
-tupletype tupletype
This specified the tuple type name to be recorded in the output. You may use any string up to 255 characters. Some programs recog-
nize some names. If you omit this option, the default tuple type name is null.
SEE ALSO
pam(5)
AUTHOR
Copyright (C) by Bryan Henderson, San Jose CA 2000.08.05
01 May 2002 pamstack(1)