0

I'm trying to load a text file into a MySQL table. The text file has 2 delimiters (tab and space). The problem is that some of the fields in the text file occasionally have NULL values. When this happens, and I split (preg_split or split) the file out into an array in PHP, instead of producing elements in the array containing NULL values, those elements are dropped. The result is a PHP array with an inconsistent field layout.

Can anyone suggest a solution?

Thanks very much.

mb

1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by mb2442
0

My mistake - the empty elements were dropped previous to the text file. Explanation for this being that the source is a syslog.

Thanks.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.