Sponsored Content
Full Discussion: Validating the file
Top Forums Shell Programming and Scripting Validating the file Post 302874261 by Don Cragun on Thursday 14th of November 2013 02:47:22 PM
Old 11-14-2013
Show us your code. And, show us your desired output (both for successful validation and failed validations!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Validating inputs from a file

Hi, I have a file called inputs. Now that file has the values like this: 1 2 3 Now In my script called 'get.sh' I do this : exec < inputs read a b c d Now I know that there will not be any value in d. How can I check it. I need the exact condition for checking whether the variable has... (1 Reply)
Discussion started by: sendhilmani123
1 Replies

2. Shell Programming and Scripting

validating a file or directory

Hi there, im writing a script and trying the get the 2nd parameter and check it if its valid file or valid directory, Example: ./test -a quiz1 i need to check quiz1 ($2) if it matches any name of a file or directory. Thanks (3 Replies)
Discussion started by: new2Linux
3 Replies

3. Shell Programming and Scripting

validating a file based on conditions

i have a file in unix in which the records are like this aaa 123 233 aaa 234 222 aaa 242 222 bbb 122 111 bbb 122 123 ccc 124 222 In the output i want only the below records aaa ccc The validation logic is 1st column and 2nd column need to be considered if both columns values are... (8 Replies)
Discussion started by: trichyselva
8 Replies

4. Shell Programming and Scripting

validating a input file for numeric and character

i have a input file like this 001|rahim|bajaj|20090102 while reading the file i need to check whether the first column is a number second column is a name is there any methodology to check for the same thanks in advance (2 Replies)
Discussion started by: trichyselva
2 Replies

5. Shell Programming and Scripting

Shell script for validating fields in a file

Hi, I have not used Unix in a very long time and I am very rusty. I would appreciate any help I can get from the more experienced and experts in Shell script. I am reading one file at a time from a folder. The file is a flat file with no delimeters or carriage return. Col1 through col6 is... (5 Replies)
Discussion started by: asemota
5 Replies

6. UNIX for Dummies Questions & Answers

Validating a file

Pardon my ignorance but I am lost on how to do this I have a file called "Sample.txt", it is pipe delimited, it should have 13 fields. But some of the records do not, I would like to set up a shell script where I can pass in a parameter "Sample.txt" and it would split the file into records... (2 Replies)
Discussion started by: dgeehot
2 Replies

7. Shell Programming and Scripting

Validating XML file using XSD in UNIX

Hi, I have a xml file and a xsd file(xml schema file). Here using unix script i wanted to validate the xml file by referring to xsd file. The validation is in terms of Datatype,Field length and null values. If the data present in the xml file is not matching in terms of datatype,field length... (3 Replies)
Discussion started by: shree11
3 Replies

8. Shell Programming and Scripting

Csv file parsing and validating

Hi, I have basic knowledge on unix shell scripting(not an expert). My requirement is reading the csv file using the schema defined in the configuration file and if the condition is not mached then move the unmatched record to a error file and matched good records into other file. In brief: ... (43 Replies)
Discussion started by: shree11
43 Replies

9. Shell Programming and Scripting

Validating a file in ksh

Ladies and Gents, I need to be able to verify the file and validate the file format. Is there a way to verify this using ksh? Please forgive me, I'm very new to UNIX scripting. 12345_dbname_1_sqlname.sql 12345 - change number dbname - database name 1 - sequence sqlname - sql... (4 Replies)
Discussion started by: Philani
4 Replies
SQLITE_FETCH_COLUMN_TYPES(3)											      SQLITE_FETCH_COLUMN_TYPES(3)

sqlite_fetch_column_types - Return an array of column types from a particular table

SYNOPSIS
array sqlite_fetch_column_types (string $table_name, resource $dbhandle, [int $result_type = SQLITE_ASSOC]) DESCRIPTION
Object oriented style (method): array SQLiteDatabase::fetchColumnTypes (string $table_name, [int $result_type = SQLITE_ASSOC]) sqlite_fetch_column_types(3) returns an array of column data types from the specified $table_name table. PARAMETERS
o $table_name - The table name to query. o $dbhandle - The SQLite Database resource; returned from sqlite_open(3) when used procedurally. This parameter is not required when using the object-oriented method. o $result_type - The optional $result_type parameter accepts a constant and determines how the returned array will be indexed. Using SQLITE_ASSOC will return only associative indices (named fields) while SQLITE_NUM will return only numerical indices (ordinal field numbers). SQLITE_ASSOC is the default for this function. RETURN VALUES
Returns an array of column data types; FALSE on error. The column names returned by SQLITE_ASSOC and SQLITE_BOTH will be case-folded according to the value of the sqlite.assoc_case configuration option. CHANGELOG
+--------+--------------------+ |Version | | | | | | | Description | | | | +--------+--------------------+ | 5.1.0 | | | | | | | Added $result_type | | | | +--------+--------------------+ EXAMPLES
Example #1 Procedural example <?php $db = sqlite_open('mysqlitedb'); sqlite_query($db, 'CREATE TABLE foo (bar varchar(10), arf text)'); $cols = sqlite_fetch_column_types('foo', $db, SQLITE_ASSOC); foreach ($cols as $column => $type) { echo "Column: $column Type: $type "; } ?> Example #2 Object-oriented example <?php $db = new SQLiteDatabase('mysqlitedb'); $db->query('CREATE TABLE foo (bar varchar(10), arf text)'); $cols = $db->fetchColumnTypes('foo', SQLITE_ASSOC); foreach ($cols as $column => $type) { echo "Column: $column Type: $type "; } ?> The above example will output: Column: bar Type: VARCHAR Column: arf Type: TEXT PHP Documentation Group SQLITE_FETCH_COLUMN_TYPES(3)
All times are GMT -4. The time now is 02:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy