I may be way off, but you don't need a driver just to read a csv (tsv, *sv) file into data structures.
Use awk, sh, perl.... etc.
For example, each night we produce a very large comma-delimited file each night for importation into a legacy application.
This will check if the file is 120 columns wide. If not, it will identify which row produced the error, and if so, will give us the output of column 52 along with the record identifier, which we can use for reporting purposes:
If it's OK, it's imported into a legacy database.
And I don't know where you are coming up with the information that MySql is derived from SyBase in any way... That would be like saying that Oracle was built on db2.
Please check your sources, as you may have been misinformed.
Like was said above in another post, we are afraid of (and do not understand the full feature-set of) any product that we are not familiar with. I suggest that if you're really going to use these tool, learn them fully before poo-pooing them.
HI guys,
I have created a script to read 1 column in a csv file and then place it in text file.
However, when i checked out the text file, it is not in a column format...
Example:
CSV file contains
name,age
aa,11
bb,22
cc,33
After using awk to get first column
TXT file... (1 Reply)
I have a large CSV files (e.g. 2 million records) and am hoping to do one of two things. I have been trying to use awk and sed but am a newbie and can't figure out how to get it to work. Any help you could offer would be greatly appreciated - I'm stuck trying to remove the colon and wildcards in... (6 Replies)
Hi All
I am trying to combine columns from multiple text files into a single file using paste command but the record length being unequal in the different files the data is running over to the closest empty cell on the left. Please see below.
What can i do to resolve this ?
File 1 File... (15 Replies)
EDIT: My problems have been solved thanks to the help of bartus11 and pravin27
This code is just to help me learn. It serves no purpose other than that.
Here's a sample csv that I'm working with -
#listofpeeps.csv
Jackie Chan,1954,M
Chuck Norris,1930,M
Bruce Lee,1940,M
This code is... (13 Replies)
Hi,
I need to parse text, xml files to get the statistic numbers and prepare summary csv file.
What is the best way to parse these file and prepare csv file.
Any idea you have , please?
Regards, (2 Replies)
:confused:Hello -- i just joined the forums. I am a complete noob -- only about 1 week into learning how to program anything... and starting with linux.
I am working in Linux terminal.
I have a folder with a bunch of txt files. Each file has several lines of html code. I want to combine... (2 Replies)
Hi,
I need to create a .csv file from information that i have in two different tab delimited .txt file. I just want to select some of the columns of each .txt file and paste them into a .cvs file.
My files look like:
File 1
transcript_id Seq. Description Seq. Length ... (2 Replies)
so...
Lets assume I have a text file.
The text file contains multiple "#" symbols.
I want to replace all thos "#"s with a STRING using DOS/Batch
I want to add a certain TEXT to the end of each line.
How can I do this WITHOUT aid of sed, grep or anything linux related ? (1 Reply)
hi
i need to extract lines from multiple files to a csv file.
for example, i have these 3 files
file1.txt
date:29dec1980
caller:91245824255
called:8127766
file2.txt
date:11apr2014
caller:9155584558
called:8115478
file3.txt
date:25jun2015
caller:445225552
called:8117485 (30 Replies)
Hi dears
i use bash shell
i have INPUT.txt
like this
number of columns different in one
some row have 12 , some 11 columns
see last column
INPUT.txt
CodeGender Age Grade Dialect Session Sentence Start End Length Phonemic Phonetic
63 M 27 BS/BA TEHRANI 3 4 298320 310050... (2 Replies)
Discussion started by: alii
2 Replies
LEARN ABOUT PHP
mysqli_fetch_array
MYSQLI_FETCH_ARRAY(3) 1 MYSQLI_FETCH_ARRAY(3)mysqli_result::fetch_array - Fetch a result row as an associative, a numeric array, or both
Object oriented style
SYNOPSIS
mixed mysqli_result::fetch_array ([int $resulttype = MYSQLI_BOTH])
DESCRIPTION
Procedural style
mixed mysqli_fetch_array (mysqli_result $result, [int $resulttype = MYSQLI_BOTH])
Returns an array that corresponds to the fetched row or NULL if there are no more rows for the resultset represented by the $result param-
eter.
mysqli_fetch_array(3) is an extended version of the mysqli_fetch_row(3) function. In addition to storing the data in the numeric indices of
the result array, the mysqli_fetch_array(3) function can also store the data in associative indices, using the field names of the result
set as keys.
Note
Field names returned by this function are case-sensitive.
Note
This function sets NULL fields to the PHP NULL value.
If two or more columns of the result have the same field names, the last column will take precedence and overwrite the earlier data. In
order to access multiple columns with the same name, the numerically indexed version of the row must be used.
PARAMETERS
o $
result -Procedural style only: A result set identifier returned by mysqli_query(3), mysqli_store_result(3) or
mysqli_use_result(3).
o $resulttype
- This optional parameter is a constant indicating what type of array should be produced from the current row data. The possible
values for this parameter are the constants MYSQLI_ASSOC, MYSQLI_NUM, or MYSQLI_BOTH. By using the MYSQLI_ASSOC constant this
function will behave identically to the mysqli_fetch_assoc(3), while MYSQLI_NUM will behave identically to the mysqli_fetch_row(3)
function. The final option MYSQLI_BOTH will create a single array with the attributes of both.
RETURN VALUES
Returns an array of strings that corresponds to the fetched row or NULL if there are no more rows in resultset.
EXAMPLES
Example #1
Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if ($mysqli->connect_errno) {
printf("Connect failed: %s
", $mysqli->connect_error);
exit();
}
$query = "SELECT Name, CountryCode FROM City ORDER by ID LIMIT 3";
$result = $mysqli->query($query);
/* numeric array */
$row = $result->fetch_array(MYSQLI_NUM);
printf ("%s (%s)
", $row[0], $row[1]);
/* associative array */
$row = $result->fetch_array(MYSQLI_ASSOC);
printf ("%s (%s)
", $row["Name"], $row["CountryCode"]);
/* associative and numeric array */
$row = $result->fetch_array(MYSQLI_BOTH);
printf ("%s (%s)
", $row[0], $row["CountryCode"]);
/* free result set */
$result->free();
/* close connection */
$mysqli->close();
?>
Example #2
Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s
", mysqli_connect_error());
exit();
}
$query = "SELECT Name, CountryCode FROM City ORDER by ID LIMIT 3";
$result = mysqli_query($link, $query);
/* numeric array */
$row = mysqli_fetch_array($result, MYSQLI_NUM);
printf ("%s (%s)
", $row[0], $row[1]);
/* associative array */
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
printf ("%s (%s)
", $row["Name"], $row["CountryCode"]);
/* associative and numeric array */
$row = mysqli_fetch_array($result, MYSQLI_BOTH);
printf ("%s (%s)
", $row[0], $row["CountryCode"]);
/* free result set */
mysqli_free_result($result);
/* close connection */
mysqli_close($link);
?>
The above examples will output:
Kabul (AFG)
Qandahar (AFG)
Herat (AFG)
SEE ALSO mysqli_fetch_assoc(3), mysqli_fetch_row(3), mysqli_fetch_object(3), mysqli_query(3), mysqli_data_seek(3).
PHP Documentation Group MYSQLI_FETCH_ARRAY(3)