# Get text range between ceratin number of text lines

**URL:** <https://forum.kirupa.com/t/get-text-range-between-ceratin-number-of-text-lines/291622>\
**Category:** Uncategorized\
**Created:** [July 2, 2009, 12:27pm UTC](https://forum.kirupa.com/t/get-text-range-between-ceratin-number-of-text-lines/291622 "2009-07-02T12:27:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![minopharma](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@minopharma](https://forum.kirupa.com/u/minopharma)\
**Post date:** [July 2, 2009, 12:27pm UTC](https://forum.kirupa.com/t/get-text-range-between-ceratin-number-of-text-lines/291622/1 "2009-07-02T12:27:09Z")

</div>

Hi to all,

I’m working on an AIR application using Flex Builder 3 with Flex SDK 4.0 installed. The main idea of the application is to read an external text file (\*.txt) into a TextArea and after clicking a button I want some text range (e.g. from line 100-200) to be copied into another TextArea.

I’ve made almost everything, but I don’t know how to extract a specific range of text between certain text lines.

I alredy made a code to get the exact number of lines of the whole input text file:

```php

//get number of lines 
function getNumLines(event:MouseEvent):void{ 
    saveButton.enabled = true; 
    var nLines:uint = inputField.mx_internal::getTextField().numLines; 
    for (var i:Number = 0;i<nLines;i++){ 
          var Line1:String = inputField.mx_internal::getTextField().getLineText(i); 
          var str:String = (1+i) + " " + Line1; 
           outputField.text += str; 
    } 
} 
extractButton.addEventListener(MouseEvent.CLICK,getNumLines);  

```

I’ve searched over the net about this problem and I’ve found **getText()** method which could be possible solution to fix this problem, but I really don’t know how to implement it in my case.

If someone have an idea or solution, will be of great help!

Thanks in advance,  
minopharma
