FAQ Database Discussion Community


Trying to get just the text from a node with filter(), but is returning an object?

javascript,jquery,dom,text
I am simply trying to extract the text without any of the elements from a DOM node with var textIWant = $('.classname').contents().filter(function(){ return this.nodeType === 3; })[1]; This returns to me what looks like a string in the console, something untrimmed like.. " text I want " so when I...

How do i split text to a different column or remove a text from the original column?

excel,vba,excel-vba,text,split
I've copied a column of data starting from D9 to D-whatever, the copied data have both decimal value and text. The data varies in each cell in column D Example D9 : 1675.87 L/s D10 : 1555.87 L/s D11 : 1635.87 L/s This is my code i tried.. Dim c...

Align rows in text file with command line

text,command-line
I have data in a text file where data rows are repeated after several columns and each new block shares the first column of row labels. I'd like to use the command line to get align the rows into a single table. The data text file looks like: Values SampleA...

How do I get an xml node text?

c#,xml,text,value
I have an xml file with nodes containing codes that I need to get into a string, if the suffix selected matches the one in the xml. This is how my xml looks like: <ntcode NTCODE="BTM"> "2","724,02F,FFFFFFFF,FFFFFFFF,FF","724,03F,FFFFFFFF,FFFFFFFF,FF" </ntcode> <ntcode NTCODE="CLR"> "1","724,05F,FFFFFFFF,FFFFFFFF,FF" </ntcode> And this is the code I'm using: XmlDocument...

Merge Text Files and Prepend Filename and Line Number - Powershell

powershell,text,powershell-v3.0
I've been trying to adapt the answer to this question: powershell - concatenate N text files and prepend filename to each line My desired output based on an example of 2 .txt files: First.txt lines of data Second.txt more lines of data Output.txt First1 lines of First2 data Second1 more...

Corona sdk not view random text

text,random,lua,corona
I'm have a problem because when I touch my button sometimes my text doe not appear and I do not understand what is wrong. Code: function randomText(event) display.remove(mmDis) local a = {"Cristiano ronaldo jest najlepszy!", "messi jest dobry!","lewandowski jest ok","diego lopez to bramkarz realu"} com = (a[math.random(1,#a)]) local mmDis =...

Splitting a text file

python,text,split
I have a folder with a set of text documents. I want to split each document to two or three documents, each one should be 45-70kb. How сan I do it? I tried: def split_file(filename, pattern, size): with open(filename, 'rb') as f: for index, line in enumerate(f, start=1): with open(pattern.format(index),...

Restricting access to some lines in JTextArea?

java,text,jtextarea
I wanted to make a JTextArea where the user can't erase the previous line. Just like the Command Prompt in Windows and the terminal in Linux, you can't edit previous lines. This is what I've come up with, but it doesn't seem to work, and I can only come up...

resize/scale text dynamically in andengine

android,text,andengine
I created a simple game where move the objects from one place to another and each moves increment count of moves in score table. After all objects are moved correct I want set opacity to screen and slowly resizing score from initial size(e.g. 15px) to whole screen(e.g. 50px). I load...

Wrapper for the matlab to read sparse data file

matlab,sorting,text,awk,libsvm
Libsvm can read the following datafile and convert it into sparse data structure in matlab (using libsvmread). -1 3:1 11:1 14:1 19:1 39:1 42:1 55:1 64:1 67:1 73:1 75:1 76:1 80:1 83:1 -1 3:1 6:1 17:1 27:1 35:1 40:1 57:1 63:1 69:1 73:1 74:1 76:1 81:1 103:1 First column is...

jQuery Make Text Change Before It's Noticeable

javascript,jquery,html,dom,text
I'm using the following code to make a text change on a website: jQuery(document).ready(function() { jQuery('div#sidebar ul.side-nav li.current_page_item a').text('Request a Quote'); }); The problem is, the change is done until AFTER the webpage has finished loading, so the user actually gets to see what was the original text before the...

SQL Server - Join Table1 to Table2 ON substring(T1.Field) = T2.ID

sql-server,text,substring,inner-join,patindex
I have two tables: MyOrders and MyDrivers. In table MyOrders, I have a column called Details (datatype TEXT - I know, but I didn't build the database...) In MyOrders.Details, there are sometimes comma-separated lists of numerical values which correspond to the ID values of table MyDrivers. The goal is to...

StreamWriter not appending to file, instead creating a new file in different directory

c#,file,text,file-io,streamwriter
I am attempting to write from one file to a temp file after making certain changes to some of the data in the source file. This was working until I extracted this logic into its own function. After running some tests I noticed that only the first line was being...

Delete the extra space after special character in all the lines of text file

bash,shell,text,awk,sed
Following data represents 2 lines of text file: 1 2340: 2 1930: 1 1 9: 3 4501: 1 45: 1 5620: 2 I want to delete the space after ":". So the output of above text file should be 1 2340:2 1930:1 1 9:3 4501:1 45:1 5620:2 ...

Corona sdk random text

text,random,sdk,corona
I`m have a problem because when i touch my button sometimes not appear my text... (Sorry for my English!) Code: function randomText(event) display.remove(mmDis) local a = {"Cristiano ronaldo jest najlepszy!","messi jest dobry!","lewandowski jest ok","diego lopez to bramkarz realu"} com = (a[math.random(1,#a)]) local mmDis = display.newText(tostring(com), display.contentWidth*0.57, display.contentHeight*0.7, display.contentWidth*0.9, display.contentHeight*0.8, "Impact",...

Canvas draw text verticaly

java,android,text,android-canvas,draw
So, I have put everything I need how i need to be, my bitmaps, backgorunds and everything, what I need is to draw text that will be vertically shown. Here is my code for now: private void drawTables(Canvas canvas) { for (Table table : mTablesList) { float x = mWidht...

JQuery add a whitespace to each new text node to prevent clumping on extraction

jquery,text,whitespace
What I do is I want to transform <div id=master> Blah <span id=crap>Blah1</span> <div id=crap2>Blah2</div> <b>Blah3</b> </div> to <div id=master> Blah <span id=crap> Blah1 </span> <div id=crap2> Blah2 </div> <b> Blah3 </b> </div> because when I extract all the text from all elements inside master it becomes looking like this...

To make a particular part of my text clickable

android,redirect,text,clickable
I'm tring to make a particular part of my text clickable. Please see the below image for example: In this image "www.google.com" is placed inside an expandable listview. Can anyone please help me how I can make this text clickable so that it re-directs to its corresponding web page ArrayList<String>...

c++ gives Segmentation Fault from text file of all 0's

c++,text,zero,fault
I'm writing a really simple code (or so I thought) that requires 2 text files to be read in. One is full of a bunch of data points (of type double) and the other one happens to be a bunch of 0's (this is only SOMETIMES filled with 0's, sometimes...

How can I wrap text in QGraphicsItem?

qt,text,word-wrap,qgraphicsitem
1) How can I wrap text in a QGraphicsTextItem to fit a fixed rectangle, with width and height ? Right now I am experimenting with creating a text, getting its bounding rectangle, and resizing it to fit the box - but I can't get wrapping. class TTT: public QGraphicsTextItem {...

Save user input into a Text widget Tkinter when using classes

python,text,tkinter
I want to know how to save text entered by the user in a Text widget when pressing a "submit" button. At the moment, I have the function submitbutton but it comes up with an error when clicking "submit." On another note, I want the top right Label widget to...

Can I put StreamReaders in a list? Or any other way to read a lot of text files at once?

c#,list,text,streamreader
I have a lot of text files and want to read them all by once, how do I do this? This is my code till now: List<StreamReader> lijst = new List<StreamReader>(); using (StreamReader qwe = new StreamReader("C:\\123.txt")) using (StreamReader qwer = new StreamReader("C:\\1234.txt")) lijst.Add(qwe); lijst.Add(qwer); But I get an ObjectDisposedException(Cannot...

importing specific information of a text file into a matrix

matlab,text,matrix
I do appreciate your helps! Thanks in advance! I have a huge text file in the following format: ********************************* timestep 455 No_Specs 3 H2 49 H2O2 1 O2 49 ********************************* timestep 460 No_Specs 3 H2O 49 H2O2 1 O2 49 ********************************* timestep 465 No_Specs 2 H2 50 O2 50 *********************************...

x axis text overlapping in matlab

matlab,text,overlap
My x axis text are overlapping. I am using this code-- clear all A=[1 2 3 4 5 6 7]'; b=1:length(A); figure(1) bar(A) title('Loss Diagram') xlabel('Loss factor') ylabel('kWh/year','fontsiz`enter code here`e',20) grid on set(gca,'Xtick',b,'XtickLabel',{'Horizntl Global Irr. ' 'Effective irr. on coll. ' 'Array nominal energy ' 'PV module loss ' 'charge...

OutOfMemory exception thrown while writing large text file

c#,text,out-of-memory,file-writing
I want to generate a string and then write it in to a .txt file. The problem is I get OutOfMemory exceptions when I attempt to do so. The file is large (about 10000 lines). I use String.Format and loops to create the string. How can I write this to...

How to display text in browsers tab bar in a javaserver page [closed]

html,jsp,browser,text,tabs
I have heard of being able to display images in a browsers tab bar here: http://stackoverflow.com/questions/120420/image-icon-beside-the-site-url But I was wondering if there might be an easier way to do this for just some simple text? I am trying to display just two lines, last login and IP address in this...

Read lines of a text file into an array

java,android,arrays,file,text
I would like to display a new quote randomly every time someone launch the app.In order to do that I was thinking of using a text file containing all the quotes, one at each line. I would like to know in android studio where should I put my text file...

Making 3 columns of text aligned at the same height or line all the time even while re sizing window

html,css,text,alignment,height
CSS: I want to make 3 columns of text aligned at the same height or line all the time even when I resize the window. To illustrate what I am talking about please take a look at the images by following this link: https://drive.google.com/file/d/0BywbaHflqMTERFVrNF84YlBUbTg/view?usp=sharing The problem is that the third...

Adding custom text to UITextField buffer

ios,objective-c,text,buffer,homekit
Background: I have got a custom alert part of the HomeKit API. I'd like to allow the user to paste the code requested rather than inputting it manually. Whenever there is text in the buffer it is possible to paste it by tapping on the textfield. How can I add...

Read text file from specific position and store in two arrays

c#,arrays,file,text
I have text file which contains line like this: @relation SMILEfeatures @attribute pcm_LOGenergy_sma_range numeric @attribute pcm_LOGenergy_sma_maxPos numeric @attribute pcm_LOGenergy_sma_minPos numeric... Where are about 6000 lines of these attributes, after attributes where are lines like this: @data 1.283827e+01,3.800000e+01,2.000000e+00,5.331364e+00 1.850000e+02,4.054457e+01,4.500000e+01,3.200000e+01... I need to seperate these strings in two different arrays. So far...

How to change content of unity text?

user-interface,text,unity3d
I create an application on unity3d. I use Unity 5.0.2f1 (64-bit). I create a new project and add an empty gameobject. I click gameobject and add a gui text from inspector. My gui text is below : I want to change the contenf of this text at each frame. I...

The variable 'buff' is being used without being defined

c,arrays,text,runtime
I need to read some data from text file and store it in 2D-array. This code works good: #include <string.h> #include <stdio.h> int main() { FILE *f = fopen("Read.txt", "r"); char buff[100][100]; char str[100]; int i = 0; while(fgets(str, 100, f)) { strcpy(buff[i], str); i++; } return 0; } But...

Get string (file name) of a given extension from within a text file

c#,string,file,text
I apologize if the question title is a little confusing, but let's say a text file contains the following data: Sample 'Line1 1 'Line2 2 'ProjectCount FileA.ext 'Projects( 1) 0 'SortTermCount FileB.ext 'Projects( 2) 0 'SortTermCount ... I know the extension name that exists as a string within the file...

Stop text from leaking out of div [on hold]

html,css,text
I have some text which is contained in a div, however if it's too long, it leaks outside of the div and I don't want that. I dont want to use the overflow attribute and give it a scroll bar. Id like it to put the "..." at the end...

How can I create large ASCII text from a string?

html,text
Given a string, for example 'imgur', how can I generate large ASCII text like the following? Thanks. _ (_) _ _ __ ___ __ _ _ _ _ __ | | '_ ` _ \ / _` | | | | '__| | | | | | | | (_|...

Error: Getting symbols in python output

python,python-2.7,text,file-io,editor
#I wrote the following code for making a text editor. print "This is a simple text editor" from sys import argv script, name = argv print "You have selected the file : %s" %name print "Opening the file...." t = open(name, 'r+') print "The contents of the file are" print...

Text showing on two lines with span

html,css,text
Please see below HTML and CSS code. HTML: <a class="navbar-brand" href="/index.php"> <img src="/img/logo.png" alt="logo"></a> <span class="navbar-brand" style="font-family:'Arial';font-size:24pt">WEBSITE NAME</span> CSS: .navbar-brand { width: 88px; height: 88px; } .navbar-brand img { width: 100%; height: auto; } The problem I'm having is that the text in the span (WEBSITE NAME) is showing on...

search string in textfile [on hold]

c++,c,string,text
Say you have a text file like this all you want from the text is the "size value" but repeats more that thousand time with different value "field_pic_flag : 0 bottom_field_flag : 0 idr_pic_id : 0 Found NAL at offset ,size 28813 !! Found NAL" "field_pic_flag : 0 bottom_field_flag :...

Parsing html using Selenium - class name contains spaces

python,html,parsing,selenium,text
I'm trying to parse some html using Selenium. The problem is that it raises error in case the class name contains spaces. Here is the tag I'm searching for: <p class="p0 ng-binding">text</p> I've tried these two options: result.find_element_by_class_name('departure').find_element_by_css_selector('p.p0 ng-binding').text result.find_element_by_class_name('departure').find_element_by_class_name('p0 ng-binding').text >>> selenium.common.exceptions.InvalidSelectorException: Message: The given selector p0 ng-binding is...

Extract text from large file using RegEx?

c#,regex,text
I have a big file that has a bunch of data in it, but essentially what I would like to do is to grab only parts of it, let me explain what parts I'm interested in: (imagine "x" as an IP Address) (imagine "?" as any alphanumerical character /w any...

Changing a read-only file [on hold]

python,text
I need to change text documents. The way I've been doing it is making a new file, copying everything line by line from the old file and making changes on the way, then saving the new file as the old file's name. This becomes a problem when I only have...

Replace text between two special characters

regex,r,text,replace
I have a character vector as: x<- "\t\t<taxon id=\"TOT_F50\"/>" and y<- "TOT_A01" and I want replace TOT_F50 with the text in y ("TOT_A01"). Do you know how to replace the text between " and \ (i.e. "TOT_F50) ? ...

Splitting a text line into separate lines from command line

text,split,command
What are some simple options to split a single text line into separate based on a character or pattern? I would like to do this from the command line. An example would be when you want to inspect the PATH. With a single simple command I'd like to split something...

Extract lines from File2 already found File1

linux,text,awk,sed,grep
Using linux commandline, i need to output the lines from text file2 that are already found in file1. File1: C A G E B D H F File2: N I H J K M D L A Output: A D H Thanks!...

Rails. Why does my submit button say Create vs. Update depending on

ruby-on-rails,button,text,submit
Be gentle to the newbie...... Ruby version 2.2.2p95, Rails version 4.2.1. I completed the sample blog application. Works great, and I've been expanding on it. But I'm a noob, and clearly missing something fundamental. From the main index, you are presented with a listing of articles, and you have some...

Apple Script : Cleaning textedit text

text,applescript,textedit
I want to clear some text from a textedit text but its only half working for me tell application "TextEdit" set documentText to text of document 1 set {oldTID, my text item delimiters} to {my text item delimiters, "Administration"} set textBits to text items of documentText set my text item...

how can I add text to these rectangles?

python,text,menu,pygame,python-3.4
This is the code I have started to use to make a start menu. # we need some colours!! black = (0,0,0) white = (255,255,200) red = (200,0,0) green = (0, 200, 0) bright_red = (255, 0 ,0) bright_green = (0, 255, 0) bright_white = (255, 255, 255) def main():...

Python outputs a .txt file, which's format differs depending on the text editor I use to open it

python,text,output
So I have some python code taht outputs some data to a .txt file like this: f3 = codecs.open(r'C:\Users\dimrizo\Desktop\PythonData\GTFS\routes.txt','w+',"UTF-8") f3.write('route_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color\n') f3.write('blah,blah,blah,blah,blah,blah,blah,blah,blah\n') Problem is that if I open the produced file with the simple windows text editor the text is not properly formatted. The "\n" don't even count. If I open...

Powershell Reading text file

powershell,text,text-files
I'm just wondering if it's possible to read the content of text file with specific index? What I mean is like this, for example: I have text file like this, 'test1.txt' 12345678900 ## ## readthistext 54321123440 ## ## hellothistext I just want to read the content of text file after...

How do I make the text of one label node take up 2 lines?

xcode,string,swift,text,sklabelnode
I have this text below that is too long to fit on the screen when it runs. How can I make this 2 lines rather than one? myLabel.text = "The weather today is going to be partly cloudy with a chance of rain" ...

HTML make your own