Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have two text file. I want to compare this two text file and want to create new text file with difference of this 2 files
Old_file.txt Contents:-
XYZ,Desc,46,XYZ,1.6000,0
XYZ1,Desc,56,XYZ1,8.6000,0
XYZ2,Desc,66,XYZ2,10.6000,0
XYZ3,Desc,76,XYZ3,11.6000,0
new_file.txt Contents:-
XYZ,Desc,46,XYZ,1.6000,0
XYZ1,Desc,86,XYZ1,9.6000,0
XYZ2,Desc,66,XYZ2,10.6000,0
XYZ3,Desc,100,XYZ3,11.6000,0
Need file:- (new_file.txt - old_file.txt)
XYZ1,Desc,86,XYZ1,9.6000,0
XYZ3,Desc,100,XYZ3,11.6000,0
Thank You in advance.
You are coping what is usually refered as "longest common subsequence problem", there are a looot of implementations of the most common algorithm. You can spot the solution of your problem working on the script provided here.
You could use the Text_Diff pear package which is pretty robust. There's also the xdiff extension, which you can do this with, using the xdiff_file_diff function
xdiff_file_diff('Old_file.txt', 'new_file.txt', 'diff.txt');
Where diff.txt would be the resulting file with the comparison between the two files.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I wrote web service which will generate label from certain parameters and will return it as PDF. Now I must improve it by returning generated label as PDF or ZPL format.
Unfortunately, I have zero knowledge on working with ZPL. What is ZPL? Is it some kind of file format? What is used for? How its generated? Any open-source PHP libraries for it?
It would be nice if someone would provide some whitepapers or some kind of reference about ZPL.
Web service is written in PHP.
I think you are looking for this information:
https://en.wikipedia.org/wiki/Zebra_(programming_language)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
It might be a strange question but I am asked if it is possible and I don't know the answer.
In Windows it is possible to add details to a file, like an author and labels etc.
Is there any way in PHP I can read these details when this file is uploaded to the server (our client would like to use it to tag files on their server).
That information you mention it's called metadata.
You can use this php library to do the trick.
http://getid3.sourceforge.net/
Out of the box functionality doesn't pass this information when uploading files using PHP.
The documentation for $_FILES shows all of the details you can get about the file
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
require "lessc.inc.php";
$less = new lessc;
$css = $less->compileFile("style.less");
so I get CSS code. Is it possible to get the compiled file, but in less format?
The reason I want that is because style.less uses imports:
#import "color.less";
And I want a .less file that includes all the less code from these imports.
What you need is actually combining, not compiling (or converting into CSS, if you will).
I believe there's no specific LESS-targeted tool that does this, but with some customization you can use file combining tools like this - A PowerShell Script for Combining Files
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How can i list the all functions i used in my site using php?I used a lot of php functions in my site.If there is any php function to check which functions are used in my site?
Check out doxygen. By running those scripts you will be able to list all functions and classes, and it links them so you can see the usage:
http://www.doxygen.nl/
You can look into running a phpxref on your codebase.
Example of function documentation output
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I would like to try to read some of text from an image with PHP.
So if I have an image like this:
How can I extract the text "Some text" into a string.
All help and suggestions are appreciated.
The process you are looking for is called Optical Character Recognition.
http://en.wikipedia.org/wiki/Optical_character_recognition
There is a package available, called phpOCR, that does exactly what you need.
http://sourceforge.net/projects/phpocr/
phpOCR ist not the best choice, I would recommend TesseractOCR for PHP "A wrapper to work with TesseractOCR inside your PHP scripts."
https://github.com/thiagoalessio/tesseract-ocr-for-php
That's called OCR. (See http://en.wikipedia.org/wiki/Optical_character_recognition ).
It's not a trival task (that's why captcha's work as good as they do).
You'd be better of googling 'OCR PHP' if you want to find solutions.