I have been provided with a .TLD file . It contains categories data for my products( they are in thousands). The problem is I need to convert it to CSV but I cannot find anything online that can do it. I tried using Excel but it converts the category ID into Exponential format. Also I need to write a code to do this. There are simply no Examples to do this (.TLD to .CSV)
Interestingly, php reads my .TLD file as a normal file. Which I tried in the following code
<?PHP
$file_handle = fopen("PG.TLD", "rb");
$line = 0;
while ( ( $row = fgetcsv($file_handle) ) !== false ) {
if ($line <=0) {
// Skip headers
$line++;
continue;
}
if($line >0){
$texts = implode(',', $row);
echo serialize($texts);
}
}
fclose($file_handle);
?>
It uses the implode function but does not use "," anywhere. Here is the output of the above code http://toorakcomputerservices.com.au/tldtesting.php I need to basically read the category ID from one file and match it with the category ID in .TLD file to get the correct Category Name. Here is the sample.TLD file
ProductGroupCode Description ProductGroupLevel
1000 Computers 1
1001 Power & Rack Equipment 1
1002 Storage 1
1003 Displays 1
1004 Communications 1
1005 Networking 1
1004128 Video & Audio Conferencing Equipment 2
1004403 Voice Over IP (VOIP) 2
1005129 Network Interface Cards 2
1005130 Wireless Networking 2
1005140 Switches & Hubs 2
1005129001154 Phone/Power Line NICS 3
1005129001155 Token Ring NICs 3
1005130001156 Antennas & Amplifiers 3
1005130001157 Wireless Access Points (AP) 3
1005130001158 Wireless Bridges 3
1005130001159 Wireless Cabling & Components 3
In this file My search is supposed to be like this,
If ProductGroupCode is 1005130001156 than get description Antennas & Amplifiers