Sponsored Content
Top Forums Shell Programming and Scripting How count number of fields in a record Post 302156073 by sureshg_sampat on Monday 7th of January 2008 05:30:03 AM
Old 01-07-2008
Oops..Got it now..Thanks a LOTT friends

Regards
Suresh
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to count the record count in an EBCDIC file.

How do I get the record count in an EBCDIC file on a Linux Box. :confused: (1 Reply)
Discussion started by: oracle8
1 Replies

2. Shell Programming and Scripting

Making changes in the fields of a record

:confused: Hi Friends, In the record below i have to make changes in the fields by putting the values stored in the temporary variables, x, y, z, p, q, r: 2) In the TBT record store the values in the various fields as: a) X in a field position 51 to 56 b) Y... (5 Replies)
Discussion started by: kanu_pathak
5 Replies

3. Shell Programming and Scripting

replaying a record count with another record count

i use unix command to take the record count for a file1 awk 'END{print NR}' filename i already have a file2 which conatin the count like ... .. rec_cnt=100 .. .. I want to replace the record in the file2 using the record i take from file1. suggest me some simple ways of doing it... (2 Replies)
Discussion started by: er_zeeshan05
2 Replies

4. Shell Programming and Scripting

awk sed cut? to rearrange random number of fields into 3 fields

I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want. The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies

5. UNIX for Dummies Questions & Answers

count number of fields not using SED or AWK

hi forums i need help with a little problem i am having. i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly. is there a way of doing this without using SED/AWK? anything would be greatly appreciated (4 Replies)
Discussion started by: strasner
4 Replies

6. Shell Programming and Scripting

Count the number of fields in column

Hi I was going through the below thread https://www.unix.com/shell-programming-scripting/48535-how-count-number-fields-record.html I too have something similar requirement as specified in this thread but the number of columns in my case can be very high, so I am getting following error. ... (3 Replies)
Discussion started by: shekharjchandra
3 Replies

7. Shell Programming and Scripting

Help with sum total number of record and total number of record problem asking

Input file SFSQW 5192.56 HNRNPK 611.486 QEQW 1202.15 ASDR 568.627 QWET 6382.11 SFSQW 4386.3 HNRNPK 100 SFSQW 500 Desired output file SFSQW 10078.86 3 QWET 6382.11 1 QEQW 1202.15 1 HNRNPK 711.49 2 ASDR 568.63 1 The way I tried: (2 Replies)
Discussion started by: patrick87
2 Replies

8. Shell Programming and Scripting

awk - count character count of fields

Hello All, I got a requirement when I was working with a file. Say the file has unloads of data from a table in the form 1|121|asda|434|thesi|2012|05|24| 1|343|unit|09|best|2012|11|5| I was put into a scenario where I need the field count in all the lines in that file. It was simply... (6 Replies)
Discussion started by: PikK45
6 Replies

9. Shell Programming and Scripting

awk - compare 1st 15 fields of record with 20 fields

I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Discussion started by: sljnk
7 Replies

10. UNIX for Beginners Questions & Answers

Is there a UNIX command that can compare fields of files with differing number of fields?

Hi, Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account. $ head -500 x.txt y.txt ==> x.txt <== TEST01 APP_USER_PROFILE USER03 APP_USER_PROFILE TEST02 APP_USER_EXP_PROFILE TEST04 APP_USER_PROFILE USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
MAXDB_FIELD_COUNT(3)							 1						      MAXDB_FIELD_COUNT(3)

maxdb_field_count - Returns the number of columns for the most recent query

       Procedural style

SYNOPSIS
int maxdb_field_count (resource $link) DESCRIPTION
Object oriented style int maxdb::field_count (void ) Returns the number of columns for the most recent query on the connection represented by the $link parameter. This function can be useful when using the maxdb_store_result(3) function to determine if the query should have produced a non-empty result set or not without knowing the nature of the query. RETURN VALUES
An integer representing the number of fields in a result set. EXAMPLES
Example #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); maxdb_report (MAXDB_REPORT_OFF); $maxdb->query("DROP TABLE friends"); maxdb_report (MAXDB_REPORT_ERROR); $maxdb->query( "CREATE TABLE friends (id int, name varchar(20))"); $maxdb->query( "INSERT INTO friends VALUES (1,'Hartmut')"); $maxdb->query( "INSERT INTO friends VALUES (2, 'Ulf')"); if ($maxdb->field_count()) { /* this was a select/show or describe query */ $result = $maxdb->store_result(); /* process resultset */ $row = $result->fetch_row(); /* free resultset */ $result->close(); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); maxdb_report (MAXDB_REPORT_OFF); maxdb_query($link,"DROP TABLE friends"); maxdb_report (MAXDB_REPORT_ERROR); maxdb_query($link, "CREATE TABLE friends (id int, name varchar(20))"); maxdb_query($link, "INSERT INTO friends VALUES (1,'Hartmut')"); maxdb_query($link, "INSERT INTO friends VALUES (2, 'Ulf')"); if (maxdb_field_count($link)) { /* this was a select/show or describe query */ $result = maxdb_store_result($link); /* process resultset */ $row = maxdb_fetch_row($result); /* free resultset */ maxdb_free_result($result); } /* close connection */ maxdb_close($link); ?> The above example produces no output. PHP Documentation Group MAXDB_FIELD_COUNT(3)
All times are GMT -4. The time now is 12:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy