Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbase_get_header_info(3) [php man page]

DBASE_GET_HEADER_INFO(3)						 1						  DBASE_GET_HEADER_INFO(3)

dbase_get_header_info - Gets the header info of a database

SYNOPSIS
array dbase_get_header_info (int $dbase_identifier) DESCRIPTION
Returns information on the column structure of the given database link identifier. PARAMETERS
o $dbase_identifier - The database link identifier, returned by dbase_open(3) or dbase_create(3). RETURN VALUES
An indexed array with an entry for each column in the database. The array index starts at 0. Each array element contains an associative array of column information, as described here: o name - The name of the column o type - The human-readable name for the dbase type of the column (i.e. date, boolean, etc.) o length - The number of bytes this column can hold o precision - The number of digits of decimal precision for the column o format - A suggested printf(3) format specifier for the column o offset - The byte offset of the column from the start of the row If the database header information cannot be read, FALSE is returned. EXAMPLES
Example #1 Showing header information for a dBase database file <?php // Path to dbase file $db_path = "/tmp/test.dbf"; // Open dbase file $dbh = dbase_open($db_path, 0) or die("Error! Could not open dbase database file '$db_path'."); // Get column information $column_info = dbase_get_header_info($dbh); // Display information print_r($column_info); ?> PHP Documentation Group DBASE_GET_HEADER_INFO(3)

Check Out this Related Man Page

DBASE_ADD_RECORD(3)							 1						       DBASE_ADD_RECORD(3)

dbase_add_record - Adds a record to a database

SYNOPSIS
bool dbase_add_record (int $dbase_identifier, array $record) DESCRIPTION
Adds the given data to the database. PARAMETERS
o $dbase_identifier - The database link identifier, returned by dbase_open(3) or dbase_create(3). o $record - An indexed array of data. The number of items must be equal to the number of fields in the database, otherwise dbase_add_record(3) will fail. Note If you're using dbase_get_record(3) return value for this parameter, remember to reset the key named deleted. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Inserting a record in a dBase database <?php // open in read-write mode $db = dbase_open('/tmp/test.dbf', 2); if ($db) { dbase_add_record($db, array( date('Ymd'), 'Maxim Topolov', '23', 'max@example.com', 'T')); dbase_close($db); } ?> SEE ALSO
dbase_delete_record(3), dbase_replace_record(3). PHP Documentation Group DBASE_ADD_RECORD(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to convert a column to last five digits

Hi Suppose I have a input.csv file like this Fort, 2034440-3333 Honda, b293489289 Toyota, 23423000 How to convert the second column to the following format, there are only two cases: a.if the last five character is a hyphen plus four numeric digit, keep the the last five digits... (6 Replies)
Discussion started by: grossgermany
6 Replies

2. Shell Programming and Scripting

Extract columns from a file if the name dont exist put blank

Hi, I am very new to Unix script. Suppose i have a file with column header: NAME1 NAME2 Address Tel And I always need to make a file with column header: ID NAME1 NAME2 EMail Address Tel For the columns that do not exist in the file, I would still like to make a column with blank. ... (11 Replies)
Discussion started by: nightrider
11 Replies

3. UNIX for Dummies Questions & Answers

Dividing a column by it's first number

Hi! Is there an easy way (maybe using awk??) to divide the values of one column of the file by it's first entry.. If I have a column: 3 4 5 6 7 I would like to divide it by 3. I want to do this for more than 100 files, so it wouldn't be practical to open file by file and... (26 Replies)
Discussion started by: cosmologist
26 Replies

4. Shell Programming and Scripting

Whether Shell script can do this task ???

In following attached 748phy.xls file, fifth column is ST_Date, which contains time and dates in this format 22-11-2012 7:54:54 PM in single column I want it to split in this format either 1st column 22/11/2012 and in second column 7:54:54 PM Or like this in separate... (13 Replies)
Discussion started by: Akshay Hegde
13 Replies

5. Shell Programming and Scripting

Reading column header

Hi, I have some 10 tab delimited flat files, for some files the column header starts from 1st row whereas for some other files the column header starts from row or row 3 or row4 and so on.... Is there any way in UNIX so that we can read the column headers dynamically.' I am new to UNIX, so... (12 Replies)
Discussion started by: kedar_laveti
12 Replies

6. Shell Programming and Scripting

Get line number in flat file

Hi, Is there a way to find out the line number from where the data starts? like if the data contains column header, irrespective of the text in the column header we should get the line number from which contains the column header. I am sorry if I haven't explained the problem clearly. ... (8 Replies)
Discussion started by: kedar_laveti
8 Replies

7. UNIX for Dummies Questions & Answers

Relative column offsets

Ive been trying to slide the second column one line down while keeping the first one in place. For a start, I tried to see if I can go through every line and print the element located on the line below with the following command, but it didnt work. Maybe awk is not the right way to do it. Matlab... (6 Replies)
Discussion started by: Alabama
6 Replies

8. Shell Programming and Scripting

Manipulating column in a file in UNIX

Hi I have a file content.txt where I want to replace the value of second column of the file with half of the value of that column. I only have to replace if the second column starts with COM_, rest all values have to be same eg, cat content.txt |COM_A|123|JHV|8475 |ABC|2765|BV|876... (7 Replies)
Discussion started by: infyanurag
7 Replies

9. UNIX for Dummies Questions & Answers

Column Header in the Spool file

Hi All, I have a problem with the column heading while spooling the data from the database. Since i want the column header, therefore i am not using SET HEADING OFF, and i am getting the header, but for the longer column name, some of the character from the column name is missing. for... (7 Replies)
Discussion started by: Pramod_009
7 Replies

10. Shell Programming and Scripting

I want to find the difference between two files, only for the header (column names)

Hi All, I want to find the difference between two files, by checking only the headers (column names) and report if any new column is added in the latest file. For Ex: If the file "declartion.txt has these columns url;image;id;showcase_id;showcase_name and the actual file "feed.txt" has... (34 Replies)
Discussion started by: Praveen Pandit
34 Replies

11. Shell Programming and Scripting

Sum column values based in common identifier in 1st column.

Hi, I have a table to be imported for R as matrix or data.frame but I first need to edit it because I've got several lines with the same identifier (1st column), so I want to sum the each column (2nd -nth) of each identifier (1st column) The input is for example, after sorted: K00001 1 1 4 3... (8 Replies)
Discussion started by: sargotrons
8 Replies

12. UNIX for Beginners Questions & Answers

Sum the values in the column using date column

I have a file which need to be summed up using date column. I/P: 2017/01/01 a 10 2017/01/01 b 20 2017/01/01 c 40 2017/01/01 a 60 2017/01/01 b 50 2017/01/01 c 40 2017/01/01 a 20 2017/01/01 b 30 2017/01/01 c 40 2017/02/01 a 10 2017/02/01 b 20 2017/02/01 c 30 2017/02/01 a 10... (6 Replies)
Discussion started by: Booo
6 Replies

13. Shell Programming and Scripting

Count number of unique values in each column of array

What is an efficient way of counting the number of unique values in a 400 column by 1000 row array and outputting the counts per column, assuming the unique values in the array are: A, B, C, D In other words the output should look like: Value COL1 COL2 COL3 A 50 51 52... (16 Replies)
Discussion started by: Geneanalyst
16 Replies

14. Shell Programming and Scripting

Transpose from row to column using timestamp in first column

Gents, Transpose from row to column, taking in consideration the first column, which contends the date. Input file 72918,111000009,111000009,111000009,111000009,111000009,111000009,111000009,111000009,111000009 72918,2356,2357,2358,2359,2360,2361,2362,2363,2364 72918,0,0,0,0,0,0,0,0,0... (12 Replies)
Discussion started by: jiam912
12 Replies

15. Shell Programming and Scripting

Sum of a column as new column based on header in a script

Hello, I am trying to store sum of a column as a new column inside a file but have to find the column names dynamically I/p c1,c2,c3,c4,c5 10,20,30,40,50 20,30,40,50,60 If i want to find sum only column c1, c3 and output it as c6,c7 O/p c1,c2,c3,c4,c5,c6,c7 10,20,30,40,50,30,70... (6 Replies)
Discussion started by: mkathi
6 Replies