jakebur01 Posted December 13, 2007 Share Posted December 13, 2007 Hello, I have some price files that our vendor provides me with that is in comma delimited format. I generally have to spend a lot of time editing this file in excell in order to get in the right format to be uploaded into our inventory program(as a tab delimited text file). I use php a lot with mysql. Would it be ideal for me to use php to edit these csv files and spit them out as tab delimited files. I am wanting to build a program with php that would edit this file automatically and save it as a tab delimited file. (The manipulation that I do to the csv files involves concatinating "TB" in front of some part numbers and calculating some costs and price quanity breaks. How should I go about doing this. Would you use mysql to edit the data. Also, can php save files across a network? Thanks, Jake Link to comment https://forums.phpfreaks.com/topic/81534-manipulating-comma-and-tab-text-files-with-php/ Share on other sites More sharing options...
paul2463 Posted December 13, 2007 Share Posted December 13, 2007 <?php function createTabList($text) { $outStr = str_replace(",", "\\t", "$text"); Return $outStr; } $str = "h,f,r,j,"; echo createTabList($str); ?> // outputs h\tf\tr\tj\t Link to comment https://forums.phpfreaks.com/topic/81534-manipulating-comma-and-tab-text-files-with-php/#findComment-414141 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.