Windows batch command(s) to read first line from text file
How can I read the first line from a text file using a Windows batch file? Since the file is large I only want to deal with the first line. ...
How can I read the first line from a text file using a Windows batch file? Since the file is large I only want to deal with the first line. ...
Does your software handle newline characters from other systems? Linux/BSD linefeed ^J 10 x0A Windows/IBM return linefeed ^M^J 13 10 x0D x0A old Macs return ^M 13 x0D others? For reasons of insanity, I am going with using the Linux version of the newline character in my text files. But, when...
Hi everyone, I have a problem with a string in C++ which has several words in Spanish. This means that I have a lot of words with accents and tildes. I want to replace them for their not accented counterparts. Example: I want to replace this word: "había" for habia. I tried replace it directly but with replace method of string class but...
I know plenty about the different ways of handling parsing text for information. For parsing integers for example, what kind of performance can be expected. I am wondering if anyone knows of any good stats on this. I am looking for some real numbers from someone who has tested this. Which of these offers the best performance in which si...
Let's say I have an existing trivial XML file named 'MyData.xml' that contains the following: <?xml version="1.0" encoding="utf-8" ?> <myElement>foo</myElement> I want to change the text value of 'foo' to 'bar' resulting in the following: <?xml version="1.0" encoding="utf-8" ?> <myElement>bar</myElement> Once I am done, I want to s...
Can anybody recommend a good method for determining the Rect of some wrapped text on an iPhone? I've tried all the built-in methods for NSString in the 2.1 SDK to no avail. The size methods never return sizes that allow me to completely fit wrapped text in my custom view. I'm drawing some user customizable text that should always be a...
How would you store formatted blocks of text (line breaks, tabs, lists - etc.) in a database (nothing specific) to be displayed on the web (XHTML) while maintaining a level of abstraction so that the data can be used in other applications or if the structure of the website were to change in the future? ...
I have a class which extends DefaultTableCellRenderer, which renders strings in a monospace font, with a particular color. By default, it appears that tabs are not rendered at all (0 spaces). How can I set the tab size and/or cause them to be rendered? edits: By "tabs" i mean tab characters, which I would just like to be rendered as som...
Hi, I'd like to read whole content of a text file to a std::string object with c++. With Python, I can write: text = open("text.txt", "rt").read() It is very simple and elegance. I hate ugly stuff, so I'd like to know what is the most elegance way to read a text file with c++? Thanks. ...
I am using the wysiwyg editor TinyMCE and I have stripped out most of the functions to create a simpler version. However, I need the make the formatting as basic as possible as well, e.g., instead of <p> tags i need to use <br /> tags. Also, I would like it to not convert ' in ’ as I will be using the output in Flash. The only edi...
Rather than population said DOM object with an external page such as HTML CFM or PHP, what if I simply want to send text? I've tried: $("#myDOMObject").val("some text"); No errors, but the object value doesn't update either. ...
I use emacs for viewing and editing code and other text files. I wanted to know if there is a way to search forward or backward for text which is marked in the current buffer. Similar to what I can do in notepad or wordpad. As in can I mark some text in the buffer and do a C-s or C-r and be able to search with the marked text without act...
No extracted data output to data2.txt? What goes wrong to the code? MyFile.txt ex1,fx2,xx1 mm1,nn2,gg3 EX1,hh2,ff7 This is my desired output in data2.txt: ex1,fx2,xx1 EX1,hh2,ff7 #! /DATA/PLUG/pvelasco/Softwares/PERLINUX/bin/perl -w my $infile ='My1.txt'; my $outfile ='data2.txt'; open IN, '<', $infile or die "Cant open $in...
I'm on OS X 10.5.5 (though it does not matter much I guess) I have a set of text files with fancy characters like double backquotes, ellipsises ("...") in one character etc. I need to convert these files to good old plain 7-bit ASCII, preferably without losing character meaning (that is, convert those ellipses to three periods, backqu...
I'm attempting to display some text in my program using (say) Windows GDI and some of the unicode characters are displayed as boxes? What is up? See also: What does it mean when my text is displayed as Question Marks? ...
I'm attempting to display some text in my program using (say) Windows GDI and some of the unicode characters are displayed as question marks? What is up? See also: What does it mean when my text is displayed as boxes? ...
I'm working on a project where I need to analyze a page of text and collections of pages of text to determine dominant words. I'd like to know if there is a library (prefer c# or java) that will handle the heavy lifting for me. If not, is there an algorithm or multiple that would achieve my goals below. What I want to do is similar...
I have an excel sheet full of times. They are formatted so that they look like: 1:00:15 However if I change the format on the cells to text, they change to the underlying numeric representation of the time: 0.041840278 How can I convert the cells to be text cells but still have the time in them ? ...
I have a program that creates daily log files that are 30-60MBs in size. I often need to open these files and search for various events. Notepad.exe takes a very long time to open a file that large. I've tried various shareware programs, some are better than notepad, but they all take a while to load these log files. I'm guessing part of...
How do you solve the problem with soft hyphens on your web pages? In a text there can be long words which you might want to line break with a hyphen. But you do not want the hyphen to show if the whole word is on the same line. According to comments on this page <wbr> is a non standard "tag soup invented by Netscape". It seems like ­...