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 2 years ago.
Improve this question
I need to parse some known file formats, one of them is the CUSCAR format, i strongly believe that RegEx will do the job ,any suggestions ?
I just looked at the CUSCAR spec, and I think you'll get some pretty ugly regex code to parse that. You could get away with it, if you are parsing only part of it. You'll have to test for speed, as your main bottleneck will be I/O.
I did something similar with the vendor files that came from QWEST. These beasties were hierarchical text files. Parsing those sucked! I'm currently creating and parsing text files between 4 to 50 million lines each (every day).
There is a nice framework called FileHelpers Library. This framework will help you create object-oriented representation of the records (text lines). It even has a nice wizard to walk you through the creation of these objects representing the records. It will handle master-detail, delimited, and fixed formats easily.
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 5 years ago.
Improve this question
My adviser told me to use Accord Framework for C# to extract features and patterns from images. Our project is about image analysis and comparison of tobacco leaves. Does anyone here have an idea on how to do it? Thank you.
This is pretty high level stuff, but from what I've learned in my time faffing with it, I'd use the Accord.Imaging library to scan your pictures. Followed by using the Accord.Neuro namespace to "learn" from some manual data you feed into it.
Seems your goal is to create a program that scans images quickly, gleaning only the useful data from the full image, and then checking for some particular features of the image. I've never used the library, but it looks like it'd be possible to use it.
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 was wondering if anyone knew how I should approach converting a pdf to bmp in C#. I wanted to do this without external libraries as sort of a longer learning experience.
I'm just stuck as to how to approach this without using other libraries I don't want.
If anyone has any open source examples I could look at to get an idea of how I should start it that would be much appreciated!
Thanks
Well, obviously you would start with the PDF Reference:
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf
Then you could try to find an open source PDF renderer and try to understand how they go about rendering stuff.
However I think you underestimate greatly how huge a task you set yourself. Even just extracting some stuff from a PDF and manipulating existing PDFs is very complex. Large companies put huge effort in it and still their libraries do not match with PDF rendering via Acrobat.
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 7 years ago.
Improve this question
How can I optimally split one big, difficult method to several smaller methods in C#? Is there any perception or functionality for this issue?
Assuming you are using Visual Studio to edit your C# code, there is built-in functionality for what you are trying to do: Extract Method Refactoring. Note that this is still a manual process - there is no automatic tool which knows how to take your entire method apart.
What to keep in mind while refactoring? Taken from Robert C. Martin's Clean Code:
The first rule of functions is that they should be small. The second rule of functions is that they should be smaller than that.
Functions should do one thing. They should do it well. They should do it only.
We want the code to read like a top-down narrative.
Use descriptive names.
The ideal number of arguments for a function is
zero (niladic). Next comes one (monadic), followed
closely by two (dyadic). Three arguments (triadic)
should be avoided where possible. More than three
(polyadic) requires very special justification
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I create two projects using dot net. I send some data from one project to another project. I already handled this using xml conversion. Now I think to convert this using json data. Which one is best?.
In most cases, json is better. Because it has less redundant text and more efficient to parse. And what's more, is's much easier to parse json in javascript so that building a web app is much more convenient.
On the other hand, XML is more readable than json. That might be the only advantage of XML in this case.
XML is more verbose, but in the other hand is pretty easy to read.
JSON is simpler but not so good to read.
If you will not have humans looking the data, maybe using JSON would be a better idea. Since its smaller and will be less of a burden in your network (If that is a problem).
The other way you could evaluate, is looking on serialization speed, and that will depend a lot on the library you are using.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm looking for a solution for a problem that seems quite common to me. But I can't find any directions.
The problem I'm having is that I receive multiple input files (xsl, xslx, csv, plain ascii) that I need to transform into one format. So I'm actually looking for a tool that can be configured to parse inputfiles and generate an outputfile in one format (preferably csv).
If such a tool doen't exist, then I will probably create one myself using Visual Studio/C#. Can anyone give me any directions to existing tools and/or C# coding examples that do similar things?
Thanks in advance!
Kind regards,
Paul
If you decide to write a parser parsing xls to CSV with C#, a nice example can be found here
http://www.c-sharpcorner.com/uploadfile/yuanwang200409/how-to-convert-xls-file-into-csv-file-in-C-Sharp/
This is not a direct answer to you question, but it may help. Here is a generalised solution for converting arbitary CSV to XML.
CSV-to-XML