I have a file that has 3 columns separated by 4 spaces. I want to have these four spaces replaced with one ;(semicolon). I've tried several different ways of doing this and have failed. Here is my script:
$filename = 'tidlist.txt';
$open = fopen($filename, 'r+');
function replaceText($text) {
$text = str_replace(" ", ";", $text);
}
fwrite($open, $text);
fclose($open);
Here is a snipet of the file(tidlist.txt) I'm trying open and write to:
192.168.207.209 T1125 192.168.207.209
192.168.105.174 T1126 192.168.105.174
192.168.105.175 T1127 192.168.105.175
192.168.105.173 T1128 192.168.105.173
192.168.242.207 T1129 192.168.242.207
192.168.051.210 T1130 192.168.51.210
192.168.053.084 T1131 192.168.53.84
192.168.128.178 T1132 192.168.128.178
supposed to be 4 spaces between the columns above. Thanks