Sponsored Content
Full Discussion: AWK embeded PERL
Top Forums Shell Programming and Scripting AWK embeded PERL Post 40740 by MIRV on Monday 22nd of September 2003 03:42:25 PM
Old 09-22-2003
Like I said I am rusty...especially with shell scripting...but that's why I am here! Smilie

So is this going to be a patch process that you are going to be running and that's why you need this info? I'm just curious is all. Now there is another way to get those field you want without awk, it with the cut command. I believe it's cut -c but you can man cut to see all the switches. I am pretty sure that you can use awk inside of Perl. As far as implementing it, you would be better off asking one these gurus here. I think that you can use it just like in a KSH script but not sure. You could always create a test file and test it out, right? Smilie Now do you need to each field ($1, $2, and $3) to go into their own files respectively or would you only one file be enough for you to retreive your info?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to embeded programm within programm

Hi, How to embeded programme within perl programme. Shankarao (2 Replies)
Discussion started by: shankarao
2 Replies

2. Shell Programming and Scripting

Define an alias with an embeded awk command ??

Hi all, I'm trying to define an alias with an embeded awk command: alias kpipe='kill `psme| grep "ifw -r" | grep -v "grep ifw -r"| awk '{print $2}'`' The problem is that the awk command (awk '{print $2}') contains two ' ..' quotes. So bash assumes that the first awk quote corresponds to... (5 Replies)
Discussion started by: jfortes
5 Replies

3. Shell Programming and Scripting

problem in embeded command substitution

$ echo $(tty|sed 's#/*/##') pts/0 $ who | grep $(tty|sed 's#/*/##') grep: 0652-033 Cannot open 0551-011. grep: 0652-033 Cannot open Standard. grep: 0652-033 Cannot open input. grep: 0652-033 Cannot open is. grep: 0652-033 Cannot open not. grep: 0652-033 Cannot open a. grep: 0652-033 Cannot... (2 Replies)
Discussion started by: wrl
2 Replies

4. Shell Programming and Scripting

awk or perl

hi all I am new to awk/perl I would appreciate it if you could help! how do I read a sub folder and their files. e.g. simulation/10ms/router1.dat, router2.dat,..., router16.dat simulation/100ms/router1.dat, router2.dat,..., router16.dat simulation/300ms/router1.dat,... (14 Replies)
Discussion started by: mmoses
14 Replies

5. Shell Programming and Scripting

Using perl grep and awk

I have a script to get server information i wrote in perl because i would like to learn it (and I use it for work). It works great, however i would like to know if there is a good way to reduce the following line. Sean (6 Replies)
Discussion started by: insania
6 Replies

6. Shell Programming and Scripting

awk vs perl

awk -F "|" '{print $2$3$4 upto $30}' file1 > file2 Same logic, i want to write it in perl I tried #!/bin/usr/perl my $line; open FH, "<file1" or die " Can't open file $!"; open FH1, ">file2" or die "Can't open file "; while (<FH1>){ $line = (split /\|/,$_); print FH2 $line;... (3 Replies)
Discussion started by: pritish.sas
3 Replies

7. Shell Programming and Scripting

awk - to -- PERL

DEAR ALL, i am using following command to fetch some records from more then 50000 files... command is taking more time .... can i have perl command for the same...( i am New to perl ) awk -F "|" '{ if($4==3244898 && $5==5000185) print $66}' *.DATA (2 Replies)
Discussion started by: arvindng
2 Replies

8. Programming

Error in Python Embeded in Qt C++

hi i have an error in script language when run it i use python 2.4, CentOS 5.5, Qt C++ 2010/04 the error is SystemError: null argument to internal routine the Python Code def main(i): print i if __name__ == "__main__": main(i) the C++ Code PyObject *objModule =... (0 Replies)
Discussion started by: HanyM.Magdy
0 Replies

9. Shell Programming and Scripting

Embeded shell variable in command line

Hello, I know this is a situation about the single quote and double literal, but I could not figure out after many search. I need to loop through thousands of different BACs sequencing to optimize kmer individually. IN=/PATH/TO/INPUT/FILES for sample in S{01..1096} do run_program... (9 Replies)
Discussion started by: yifangt
9 Replies

10. UNIX for Beginners Questions & Answers

Converting awk to perl

Hello. I'm currently teaching myself Perl and was trying to turn an awk code that I had written into Perl. I have gotten stuck on a particular part and a2p has not helped me at all. The task was to take a .csv file containing a name, assignment type, score and points possible and compute it into a... (1 Reply)
Discussion started by: Eric7giants
1 Replies
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)
All times are GMT -4. The time now is 07:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy