Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is it possible or any library available for creating .csv file in ObjC ?
Thanks
A CSV file is a text file of comma seperated values.
You could write an a routine that loops through values adding each one to a text file (or even add the values to a string?). After each field, add the ',' character. At the end of each row, add a new line. The first row can be the field titles.
E.g.
Year,Make,Model
1997,Ford,E350
2000,Mercury,Cougar
Here is a wikipedia article that describes what CSV is. I hope it can help.
CSV files are very simple.
If the data for each row is held in an array you could use -NSArray componentsJoinedByString:to create a row for the CSV file. You'd also have to escape the text but that's shouldn't be too tricky. All that's left is appending the row to a file.
You may also like to read Writing a parser using NSScanner (a CSV parsing example), which explains how to read a CSV file.
Take a look at chcsvparser.
NSArray has some functionality that can accomplish at least some of this (depending on whether or not you need to escape characters) pretty readily. Take a look at the componentsJoinedByString: method.
NSString has a partner method - componentsSeparatedByString:
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I have a question:
When I open an mp3 file with a text editor(sublime text), a few hundred thousand numbers in 4 digits appear(like picture below).
I got curious and experimented, deleting sections of the file and playing the mp3 file.
When I deleted the first parts, the music played but the file's CD artwork disappeared. When I deleted a huge chunk of the middle section, the music played but was shortened, with the middle part of the song gone.
Do you know what each part of the picture-letter combination represents?
I want to manipulate mp3 files(slow them down, lower the pitch, etc.) with python by modifying these numbers.
Do you have any insight on this, or what I can google to further explore?
Thanks!
This are hex values and represents how the bytes in you mp3 are laid out in memory. To manipulate them you can think of some ideas of your own for example if you just want to slow the mp3 down you can just copy each hex value and repeat them adjacent to each other. This will result in program reading the same value for a longer time and thus slowing down the tempo. The more copies you make the slower the music will play. Making the music fast requires deleting alternate bytes. Likewise you can think of more ways to manipulate these hex values. For example you can add echo, cancel noise in an audio however I don't know how that's done.
I would suggest looking at an MP3 file structure specification. Each MP3 file is composed of multiple frames and tags. Those hex values you are looking at hold the content for each frame. Modifying each frame will allow you to adjust the sampling rate and bitrate.
For more in-depth information on the MP3 specification, I would take a look at
http://www.multiweb.cz/twoinches/mp3inside.htm
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Last year, I made an application in Java using PDFBox to get the raw text in some PDF files and I need to port that application to C++ now.
I wanted to know what was the best C++ alternative to accomplish what I need.
I'll give an example in case it helps:
Most files will look like this: http://www.jumbala.net/backup/league.pdf
With PDFBox, using that file, each line read on page 2 and most of page 3 would output all the data of a line, separated by a space instead of keeping it in a grid like it is now.
So the first relevant line in page 2 would look like this:
FB 847 - Tremblay, Gérard 179,63 56 16167 90 268 s27 p3 669 s14 199 223 193 615
or something like that since there are minor changes in the order they appear, but I don't care about that as long as similar lines output the same since I just parse them and put the values I need in different variables.
So, knowing all of that, is there a library that I can use in a C++ program to get similar results?
Edit: After looking at sacredFaith's link at http://www.codeproject.com/Articles/7056/Code-to-extract-plain-text-from-a-PDF-file and trying it, I'm getting a weird output like such for the example file I mentioned earlier:
http://www.jumbala.net/backup/league.pdf.txt
The parts I actually need are in the weird characters at the beginning. Using Adobe Acrobat Reader X and using Save As... Text (accessible), I get the following result:
http://www.jumbala.net/backup/league_good.pdf.txt
Which is approximately what I get in Java using PDFBox and what I want to get as output in C++.
Xpdf is a C++ application/library which includes tools to extract plain text from a PDF file.
Since that's what your looking for : PoDoFo is C++ library to parse/read/modify or create pdf files. The library is cross-platform.
I've never used the following, but after some Googling I found this:
http://www.codeproject.com/Articles/7056/Code-to-extract-plain-text-from-a-PDF-file
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Is there any pure C++ library to extract plain text from a .doc file?
I'm developing a C++ program to read .doc and .pdf files. I have to extract plain text from the file and write it into a .txt file.
You could have a look at the open source C library used by Abiword, wv.
You can also call out to a batch convert tool
Open source batch converter, based on OpenOffice: http://dag.wieers.com/home-made/unoconv/
The open source for unix: http://www.wagner.pp.ru/~vitus/software/catdoc/
Proprietary for windows: http://doc2txt.com/. Note I havn't tried this one.
If you want to manipulate/read .doc files, you can just take the time and learn the format and manipulate the .doc file manually. You can get it at the MSDN page linking to the format-specification (PDF file).
I admit, it's quite a bit of reading to do, but if you're looking to create software to manipulate/read files, you should have the relevant underlying knowledge to back it all up.
Same goes for the pdf format (which is an open format, and as such specifications should be easy to find).
For doc - Use the Word object model to get to the the document and extract the text. This example uses OLE Automation and C . Another link for DOCX that might help you.
For PDF - Use Haru .
You could always use OIVT (OutsideIn Viewer Technology, I think) now owned by oracle.
I'll be honest, it's not a cheap solution, and while this product is to allow you view, print, etc... I think if i remember correctly, they do offer an option to extract the content to text or they another product that does that. it can do this from pretty much any document type including doc, docx, pdf (just to name a few) without having to use the "original" application installed as they have their own set of filters.
Here's a link to get you started
Outside In Viewer Technolog
Good luck
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 months ago.
Improve this question
I'm we're trying to figure out if there would be a way to convert a .txt file to a .pdf file. Here's the catch. This needs to be done behind the scenes, and on the fly. Meaning, with a radio control selected, OnOK would create a .txt file. Behind the scenes, at run time, we would like for the .txt file to be converted to a .pdf file. Ideally we would like this to be done by running an executable in the background. The executable would take input "File.txt" and output "File.pdf". We're using C++ and Visual Studio 6.
Does anyone have any experience on this? Is this possible?
libHaru may do what you want. Demo.
This a2pdf tool will probably do the trick with minimal effort. Just be sure to turn off perl syntax highlighting.
http://perl.jonallen.info/projects/a2pdf
I recommend using this open source library.
Once you have the base for generating PDF documents programmatically, you would still need a method for converting the text to the PDF elements, while keeping the text flow and word wrapping. This article may help. Please pay attention to the DoText(StreamReader sr) function. It takes text and purge it into separate lines within the PDF document, keeping the rendered within the margins.
On of the simpler methods that has worked for 3 decades e.g. more than one quarter of a century is place a postscript header before the text then use ghostscript ps2pdf it is the same method as used by some commercial apps such as acrobat
at its most basic
Copy heading.ps file.txt printfile.ps
GS -sDEVICE=pdfwrite printfile.ps printfile.pdf
Master Example can be seen here
How to modify this plaintext-to-PDF-converting PostScript from 1992 to actually specify a page size?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm just wondering if anybody knows an open source project devoted to convert ppt (or pptx) file to an easy-to-render format - html, jpg or other picture type, pdf...
I've developed some code to start reading an office file (I'm talking about the Compound Binary File) and now I've started to crack on the internal ppt streams like Picture and PowerPoint document. But each stream, as many of you know, it's huge, and write code to render it is a massive job. So, if anybody knows an Open Source project that reads and export it to an easier file to render, (must be in C++ or C - could be in C#, java since it doesn't use any API/lib facility)
Please, don't ask me why I'm doing this :-).
I really appreciate.
Powerpoint has an option to save as web-page or publish as web-page. It can be found under the file menu. You could also look into using the following which supposedly gives more control of layout: pp2html
The applications in the KOffice 2.x suite are easily scripted to output PDF, and ImageMagick can be utilized to split a PDF into pages if desired.
$ kpresenter --export-pdf --export-filename output.pdf input.ppt
Loading file /home/ephemient/input.ppt
UserEditAtom
LastSlideID 256
MajorVersion 768
MinorVersion 3516
Offset Last Edit 0
Offset Persist Dir 151466
Document Ref 1
/home/ephemient/input.ppt loaded. Done.
$ convert output.pdf page.png
$ ls -1v
input.ppt
output.pdf
page-1.png
page-2.png
page-3.png
...
Have you tried NPOI?
Best