10-10-2007
Genious effort.
thank u v much. It works. I appreciate ur efforts.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hey all,
Can I put sed command inside the awk action ?? If not then can i do grep in the awk action ??
For ex:
awk '$1=="174" { ppid=($2) ; sed -n '/$ppid/p' tempfind.txt ; }' tempfind.txt
Assume: 174 is string.
Assume: tempfind.txt is used for awk and sed both.
tempfind.txt... (11 Replies)
Discussion started by: varungupta
11 Replies
2. Shell Programming and Scripting
Hello - is there any way in awk I can do...
4861 x(1) y(1) z(1)
4959 x(1) y(1) z(1)
5007 x(1) y(1) z(1)
4861 x(2) y(2) z(2)
4959 x(2) y(2) z(2)
5007 x(2) y(2) z(2)
4861 x(3) y(3) z(3)
4959 x(3) y(3) z(3)
5007 x(3) y(3) z(3)
to become...
4861 x(1) y(1) z(1) 4861 x(2) y(2) z(2)... (3 Replies)
Discussion started by: catwoman
3 Replies
3. Shell Programming and Scripting
Hi Friends.
Please have a look at dummy file. I need to extract from this file:
1. Counts of event=
2. the 2nd coulmn is unique call id of this transaction. Based on that, i have to search for txstatus= .
Note: Values of event, calltype and txstatus can be anything.
I want to print... (1 Reply)
Discussion started by: itsmesanju
1 Replies
4. Shell Programming and Scripting
Hello all,
I am writing up an input file and I was hoping I could get some guidance as to how to best consolidate these 2 awk statements for 1 while loop.
Here's my input file
# cat databases.lst
#NOTE: These entries are delimited by tabs "\t"
#oracleSID name/pass
#
db11 ... (2 Replies)
Discussion started by: Keepcase
2 Replies
5. Shell Programming and Scripting
please let me know if the below code could be written efficiently inside single awk
case "$INP" in
ksh)
cat catalog | awk 'BEGIN {FS=",";} { print $2 } END {}'
;;
pset)
cat catalog | awk 'BEGIN {FS=",";} { print $3 } END {}'
;;
dml)
cat catalog | awk 'BEGIN {FS=",";} {... (2 Replies)
Discussion started by: cvsanthosh
2 Replies
6. Shell Programming and Scripting
Folks - newbie bash coder here and I'd like to get your help to make the code below work. As you can see, I was trying to count the total number of lines with the 3rd value >= 15 in a file and wanted to make the threshold "15" configurable, but apparently the $THRESHOLD value was not populated... (3 Replies)
Discussion started by: bashzipper
3 Replies
7. Shell Programming and Scripting
Hello again everyone,
yes, I'm back again for more help! So I'm attempting to read two separate files and generate some XML code from that. My current code is:
BEGIN {
print "<?xml version=\"1.0\" encoding=\"utf-8\">"
print "<Export>"
}
{
x=1;
print "<section name=\"Query" NR "\">"... (5 Replies)
Discussion started by: Parrakarry
5 Replies
8. Shell Programming and Scripting
Hi Gurus,
I have a command to assign value based on input value.
current condition is "if pattern matches "case", then assign "HOLD" else "SUCC"right now, I need to add one more condition (variable name is VAR).
the condition is "if pattern1 matches "case", then assign "HOLD" else if... (2 Replies)
Discussion started by: ken6503
2 Replies
9. Shell Programming and Scripting
I am trying to parse a text file and send its output to another file but I am having trouble conceptualizing how I am supposed to do this in awk.
The text file has a organization like so:
Name
Date
Status
Location (city, state, zip fields)
Where each of these is on a separate line in... (1 Reply)
Discussion started by: kellyanneghj
1 Replies
10. Shell Programming and Scripting
Hello.
I would like to convert the following piece of code from bash to awk.
Here are bash variables in a bash script.
CUR_ROW_ID and ROW_ID_TO_SEARCH contains a string which represent a row id.
The string contain a valid row id.
CUR_ROW_ID sometimes may be null.
CUR_VALUE... (3 Replies)
Discussion started by: jcdole
3 Replies
LEARN ABOUT DEBIAN
dbview
DBVIEW(1) Database Management DBVIEW(1)
NAME
dbview - View dBase III files
SYNOPSIS
dbview [-b|--browse] [-d delim| --delimiter delim] [-D|--deleted] [-e|--description] [-h|--help] [-i|--info] [-o|--omit] [-v|--version]
[-r|--reserve] [-t|--trim] dbfile
DESCRIPTION
Dbview is a little tool that will display dBase III files. You can also use it to convert your old .dbf files for further use with Unix.
It should also work with dBase IV files, but this is mostly untested.
By default dbview displays the contents of a dBase III or IV database file. This is be done by displaying both the name of the field
itself and its value. At the end of every record a newline is appended.
OPTIONS
If no option given dbview only displays the database in its most friendly way.
--browse, -b
switches into browse mode. Using this mode no fieldnames will be displayed, instead every record will displayed in one line using a
delimiter to separate fields.
--delimiter, -d delimiter
The default delimiter in browse mode is the colon sign ``:''. This parameter overrides it. This can be useful especially if you
plan to examine the output with scripts.
--deleted, -D
displays deleted records as well as the delete state in each record in the database.
--description, -e
displays the field description of the database.
--help, -h
displays a complete (or short) help screen.
--info, -i
displays some (partially technical) information about the database like number of records and length of each record.
--omit, -o
omits displaying the whole database. Using this parameter can be useful if you're only interested in the structure.
--reserve, -r
Normally fieldnames are converted into a more friendly format. They are stored in capital letters, but that looks like shouting.
This parameter supresses the conversion.
--trim, -t
When this option is specified, leading and trailing spaces are omitted. This might be useful when in browse mode.
--version, -v
displays version and exits.
NOTES
As dBase is DOS, umlauts are stored using a different code table (namely ASCII) than most modern unices (namely ANSI). If you encounter
such a file, I would recommend piping the output through recode(1) with ibmpc:latin1 as it's argument.
If you want to examine the output generated by the browse mode, just take cut(1) and set its delimiter to the used delimiter or take awk(1)
and continue.
COPYRIGHT
Dbview is free software. It is based on routines from unknown source that I found on nic.funet.fi in /pub/msdos/languages/c as dbase.c.
The file contained the following notice:
These functions are provided by Valour Software as a gift.
I have modified and included this file and wrote a skeleton around it. All together provides a powerful tool for dBase III and IV database
manipulation under Unix.
I mainly have written this program, because I've got several dbase files containing important information for me. As I won't go running
DOS everytime I need some of the stored information, I had to find a viewer that runs unter Unix, resp. Linux, but unfortunately didn't
find one. So it was my turn.
This package as a whole is published under the GNU Public License, which is a great invention.
It wasn't the intention to write a freaking viewer and reinvent the wheel again. Instead dbview is intend to be used in conjunction with
your favourite unix text utilities like cut, recode and more.
Martin Schulze
Infodrom Oldenburg
joey@infodrom.north.de
SEE ALSO
recode(1), more(1), awk(1), cut(1).
Unix November 20th, 2006 DBVIEW(1)