What I am trying to do here is open a text file called cvcmdf.txt. In that text file there are 1000 records of information that I need to post into a table. The reason I cannot use LOAD DATA LOCAL INFILE is the text file is a flat file, which mean its fields are all a fixed character width.
Is there anyway to open the file go through one record and pull out different values based on substrings?
Can you give an example of what you have and what the end result should be?
You could fopen the file, then loop through the rows and use substr() to seperate each row. Something like this
$col1= substr("$line", 0, 5); $col2= substr("$line", 6, 20);
etc..