Accessing values inside a .sor file - c#

We have to work on .sor files for a research project. This type of files contains graphical information of distance(m) to loss(dB). I think that .sor files should contain the values of each loss against distance. Is there a way to access these values?

You can buy the SR-4731 document, which describes the Optical Time Domain Reflectometer (OTDR) Data Format, which is used in .sor files, for $ 750 here. Gotta love proprietary formats.

Someone made a library and ported it to multiple languages: Python, Perl, Clojure, Nodejs and Ruby.
Here I will link the Python version.
https://github.com/sid5432/pyOTDR
as for C#, I do not know any existing port yet.

Related

Reading Excel files without a library

I am trying to figure out how excel files are written, so I can read and edit them in C# without a library (because I like to make work for myself like that). When opening them in notepad, all you can see is strange wingding characters, so immediately I thought, I might get some results when reading in a byte array. No luck, I do get a sensibly sized byte array, but converting it to a string ends up with a useless result!
So I guess my question is, how are excel files written, and how can I read them without a library?
A good place to start would be this project : Excel Data Reader CodePlex
It has working code, and you'll be able to learn the older format "xls". "XLSX" is really more the new OpenXML document standard. A link to an SDK from Microsoft for that:
Open XML for Office Developers (Microsoft)
I wanted to learn the formatting myself for some mono work I've been doing.. the older file format "XLS" isn't exactly something that you'd "learn". Pretty complicated if you ask me. Ended up just waiting for a mono product to appear rather than buying source from a number of vendors.. and porting to mono.

IFilters for index service for DICOM c#

Im trying to use Index service server for searching on DICOM files. I wanted to know if Index service does support .dcm and .dicom file extensions. I did read about IFilters but was unable to find any for DICOM files. Thanks!
The windows indexing service became "Windows Search" when XP came along.
I've never come across anyone using it for DICOM, but I imagine it wouldn't be too hard to use the SDK to write a filter to pull DICOM tags out of files and index them.
However, I suspect it's just going to result in a massive amount of information overload; a DICOM study typically contains several series plus captures/derived series, and each series could be thousands of individual files (ok the latter less of a problem with modern extended DICOM and one-volume-per-file, but there's still a massive amount of per-slice-files out there and being produced). File-level indexing alone doesn't sound that useful. If Windows Search could be made aware of the hierarchy and let you search for studies/series that might be more interesting. But most people just keep their DICOM in a PACS of some sort which will generally have excellent DICOM-oriented search/navigation tools.

Is it possible to create multilingual help (.chm) file?

I need to create multilingual help (.chm) file for my WPF application. Please suggest best way to create it.
I'd try to steer clear of that if possible. CHM is a proprietary format and, although it has been reverse engineered, I think you'll get far more benefit from doing a truly portable solution like on-disk HTML.
Back when we still used CHM files, we found no easy way to embed multi-language capability into a single file and we had to provide translations in independent CHM files, leading to massive duplication of things like charts, pictures and so forth (this was many years ago so you should check if the situation has improved since then, if you really want to use CHM).
The support for Unicode was, shall we say, less than adequate, and there were numerous security problems which caused many customers to disallow use of CHM files - seriously, who in their right mind allows arbitrary code to be run by a help system?
With on-disk HTML, not only did this duplication disappear (since each language version included common images), we also got much better Unicode support and the ability to have a default front page (in English) with links to alternative front pages for other locales.
And we gained a big boost in portability since it's an open standard. That means we could pretty much run it in any browser on any platform.
And, on top of that, it appears Microsoft don't support it any more. From the Wikipedia CHM article:
In 2002, Microsoft announced security risks associated with the .CHM format, as well as security bulletins and patches. They have since announced their intentions not to develop the .CHM format further.
As the comments in the previous answer state, the CHM format is both a very old format by Microsoft, as well as being proprietary. Distributing HTML files with your application will accomplish the same functionality as a single CHM file. Worrying about the language of the user interface the user will see is more of a non-issue; chances are if the user is reading Italian help, he or she will be using a (1) Italian-localized version of Windows and (2) an Italian-language localized web browser.
That being said, because CHM is an old format and seemingly partially unsupported now, you can generate the same file based on the reversed engineered specification that the CHM files follow. Furthermore, because CHM is merely a binary file format emcompassing HTML files, encoding the HTML files using UTF-8 will accomplish getting the help documents themselves in whichever language you desire.
There is no Microsoft-supported CHM .NET API, so you'll have to output the Binary yourself using Streams / BinaryWriter.

Compare PDF documents in Adobe Acrobat via SDK

We are planning on implementing a solution for comparing different revisions of a PDF document in our .Net Windows Forms application. In Adobe Acrobat there is a nice feature for comparing two documents, but I have not been able to find any information about whether it is possible to create a plug-in (or something else) to this feature from our application.
I would really appreciate it if any of you could point me in the direction to how I should go about to make such a solution.
I have also looked at other threads here at Stackoverflow for comparing PDF documents, particularly these threads:
How to compare two PDF-files
PDF-libraries
I did not really find a good solution there for a library or SDK letting us create a good solution for comparing PDF-documents in a way which is easy to understand for users of the system.
Do you know any good solutions to solve this problem?
All help appreciated! :)
Do you know the pdf files? or you just want to make the compare without knowing it. If you know the pdf files, you can use variables values on the specific fields and compare the values between files, instead comparing the entire pdf file.

Best way to extract data from Microsoft Word

The release notes of a software have some important data that I would like to extract in every release. Is there a way to extract certain information from Microsoft Word?
The application that I am thinking of would be written in C#, but I am okay if it is any other solution.
All MS Office products (Word, Office, etc.) are totally scriptable, both internally (using VBA) and externally (via OLE Automation, also known as ActiveX; in fact, VBA uses the interface exposed through OLE).
My suggestion would be to look for a library in your language that supports this. Here is a link to a Perl module, Win32::OLE, that does: as you can see, it's quite easy to use and very powerful. The interface should be similar for other languages.
I went through this a few years back. You can:
Use Word to convert the file into some other format, ASCII, RTF, XML etc.
Use some third-party app to convert to another format, such as ASCII.
Access the Word API through OLE and extract the information directly.
I couldn't find any generic libraries to read Word files, and back then all of the applications that read Word files only worked for a subset. Word changed often enough that they had trouble keeping up.
There were some documents that listed the specifics of the older Word file formats, the underlying file structure is outrageously complicated. Without a lot of resources it would be hard to keep code in sync with the file format.
Initially, I used Perl to drive Word and create new documents, but the solution was too fragile. Later I switch the whole application to work with PDFs instead, and gave up on Word.
Paul.
Probably not the most elegant solution but this seems to be the lightest method: Use a Cscript.
Just tried it on a sample word doc(2003) and it works perfectly.
More information: http://www.gregthatcher.com/Papers/VBScript/WordExtractScript.aspx
I did a lot of excel programming with the VSTO (Visual Studio Tools for Office) tools, I think you will be able to use the VSTO API to read a word doc. You should be able to use C#
You could write an IFilter to extract text from word files. No need to have Word installed.
You can work from within Word (VBA, VSTO) or outside it.
From outside it, automation is one approach.
Another is to avoid using Word entirely. If the docs are .docx, you can use anything which can manipulate an Open XML file. Microsoft has its Open XML SDK, and in the Java world you can use docx4j or POI.

Categories

Resources