Sponsored Content
Full Discussion: Unix/Linux Scripts questions
Top Forums UNIX for Dummies Questions & Answers Unix/Linux Scripts questions Post 302138803 by vgersh99 on Wednesday 3rd of October 2007 01:20:59 PM
Old 10-03-2007
let me simplify it for you:
Code:
nawk '
    NF != 7 {
        printf("[%d] has invalid [%d] number of fields\n", FNR, NF)
    }
    $5 !~ /^[0-9]+$/ {
        printf("[%d] 5th field is invalid [%s]\n", FNR, $5)
}' ColCheckMe

Is it somewhat easier to parse/understand?
You should be able to see some of the familiar C/C++ concepts.

As far as helping others... I'm always willing to go 'extra mile' for someone who's willing to take a ride with me investing his/her/its own time investigating the "hints" given.
Having said that.... I'll close the 'brickbats' discussion.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Absolute n00b questions about Unix / Linux

Hi All, I have absolutely no experince with either one, and would LOVE to start from somewhere! So please guide me to some web sites (beside these great forums of course!) that I can obtain n00b information. (Books, links, resources, etc.) What software OS? should I begin with? I have heard... (2 Replies)
Discussion started by: CodeHunter
2 Replies

2. UNIX for Dummies Questions & Answers

pulling scripts from unix to linux

:confused: I am working on transferring "good" running code scripts from unix to linux (suse). Some errors show in linux that are not present in unix. Specifically, the error code is: codename : no closing quote This is referring to the last line of the code + one line. I have used temporary... (3 Replies)
Discussion started by: pjconfig
3 Replies

3. What is on Your Mind?

Questions about Unix/Linux

Hello all. Im a young lad with very limited experience with computers, even though I have been playing with them the past 5 years. I have the experience of the random World of Warcraft player that plays games all day. I have a huge interest in learning everything about computers and I was... (5 Replies)
Discussion started by: Vallzi
5 Replies

4. Windows & DOS: Issues & Discussions

UNIX/Linux for Windows? and a few other questions...

1) I want UNIX but I don't want to partition my hard drive. I have heard of programs that allow you to start UNIX from Windows but I don't know which one is good. Something like WinLinux (not too sure???) Anyone know which programs I'm talking about? 2) Is Linux UNIX? 3) How do you pronounce... (9 Replies)
Discussion started by: CornNuts
9 Replies

5. UNIX for Dummies Questions & Answers

Few questions on unix/linux

Hi , please give few answers for this questions:confused::confused: ...thanks in advance What shell do you use when you log in to a UNIX/Linux host? What command will show you the shell you're using? Describe 5 things you can do in Linux/UNIX. (1 Reply)
Discussion started by: hecker007
1 Replies

6. UNIX for Dummies Questions & Answers

Unix and Linux questions

Sorry for the dumb question......I got my B.S. in computer science Amazing how I don't these answers).....I wrote mostly in the language C in my college career. I wrote all my programs using a windows application for writing C.....and then after testing it, I would upload it to a UNIX system and... (1 Reply)
Discussion started by: Bruuuuce78
1 Replies

7. UNIX for Dummies Questions & Answers

Unix vs linux in the job place and other questions

hello all, im new to this site...and look forward to corresponding with you all. i am a microsoft kid (sad) currently i work on small networks and repair computers for home and business. i want to better my skill set...but dont want to carry on down the MS route. Basically i want to... (12 Replies)
Discussion started by: j0n1n
12 Replies

8. UNIX for Dummies Questions & Answers

Alternate of UNIX scripts in Linux

Hai All, Greetings.... I am doing a migration from Solaris to Linux .There are few scripts (logadm, nfsfind, gsscred_clean, kprop_script) for which I need a alternate in Linux. If somebody can help. Thanks in advance (1 Reply)
Discussion started by: Dilipkumarkm
1 Replies

9. Shell Programming and Scripting

Scripts imported from UNIX to Linux are not working

Hi, Recently we migrated our app from Unix to Linux platform. All our shell scripts which use to work in Unix platform are not working in Linux now. below is such sample script. I tried removing trailing spaces, but no luck. dear experts kindly help.. #############BEGIN############### split... (7 Replies)
Discussion started by: laxman_bly
7 Replies
MAXDB_FETCH_FIELDS(3)							 1						     MAXDB_FETCH_FIELDS(3)

maxdb_fetch_fields - Returns an array of resources representing the fields in a result set

       Procedural style

SYNOPSIS
mixed maxdb_fetch_fields (resource $result) DESCRIPTION
Object oriented style mixed maxdb_result::fetch_fields (void ) This function serves an identical purpose to the maxdb_fetch_field(3) function with the single difference that, instead of returning one resource at a time for each field, the columns are returned as an array of resources. RETURN VALUES
Returns an array of resources which contains field definition information or FALSE if no field information is available. Object properties +-----------+---------------------------------------------------+ | Property | | | | | | | Description | | | | +-----------+---------------------------------------------------+ | name | | | | | | | The name of the column | | | | |max_length | | | | | | | The maximum width of the field for the result | | | set. | | | | | type | | | | | | | The data type used for this field | | | | | decimals | | | | | | | The number of decimals used (for integer fields) | | | | +-----------+---------------------------------------------------+ EXAMPLES
Example #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } $query = "SELECT name, cno from hotel.customer ORDER BY cno"; if ($result = $maxdb->query($query)) { /* Get field information for all columns */ $finfo = $result->fetch_fields(); foreach ($finfo as $val) { printf("Name: %s ", $val->name); printf("Table: %s ", $val->table); printf("max. Len: %d ", $val->max_length); printf("Flags: %d ", $val->flags); printf("Type: %d ", $val->type); } $result->close(); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } $query = "SELECT name, cno from hotel.customer ORDER BY cno"; if ($result = maxdb_query($link, $query)) { /* Get field information for all columns */ $finfo = maxdb_fetch_fields($result); foreach ($finfo as $val) { printf("Name: %s ", $val->name); printf("Table: %s ", $val->table); printf("max. Len: %d ", $val->max_length); printf("Flags: %d ", $val->flags); printf("Type: %d ", $val->type); } maxdb_free_result($result); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: Name: NAME Table: max. Len: 10 Flags: -1 Type: 2 Name: CNO Table: max. Len: 4 Flags: -1 Type: 0 SEE ALSO
maxdb_num_fields(3), maxdb_fetch_field(3), maxdb_fetch_field_direct(3). PHP Documentation Group MAXDB_FETCH_FIELDS(3)
All times are GMT -4. The time now is 10:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy