text between the line

This is a discussion on text between the line within the Linux Programming forums, part of the Platform Specific Boards category; hi all i have a text file like this [1]Home > [2]F&O > Watch All contracts of NIFTY As on ...

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    136

    text between the line

    hi all
    i have a text file like this

    [1]Home > [2]F&O >
    Watch

    All contracts of NIFTY
    As on Hours IST

    Instrument Type Underlying Expiry Date Option Type High
    Price Low Prev Close of contracts traded
    Turnover Lakhs Underlying Value

    [5]AAAAA [6]GGGGGG [7]25OC200 - - 5389.80 5203.10 5673.15 5255.00
    89085 234115.83 5143.90
    [8]AAAAA [9]GGGGGG [10]29NO2007 - - 5389.00 5211.00 5674.00 5269.95
    5265 13869.14 5143.90
    [11]BBBBBB [12]GGGGGG [13]25OC200 [14]CE [15]5600.00 74.00 15.00
    168.60 34.05 810 2281.01 5143.90
    [16]AAAAA [17]GGGGGG [18]27DE200 - - 5410.00 5125.00 5664.05 5265.00
    694 1828.64 5143.90

    [121]Top
    [1]http://www.google.com/
    [2]http://www.google.com/
    [7]http://www.google.com/
    [79]http://www.yahoo.com/
    [2447]http://www.google.com/
    [700]http://www.yahoo.com/

    i this text file i have to read only the text below
    "Turnover Lakhs Underlying Value"
    and above "top".

    the remaning part of the text delete and save the text file.
    means i wanna data between "Turnover Lakhs Underlying Value" and "top".


    is there any way ( any script)
    please help me

    thank you in advance

  2. #2
    Registered User
    Join Date
    Jan 2007
    Posts
    104

    Use File handling

    U can use file handling for this purpose............
    Check the starting content of line "Turnover" and apply logic that if it is found then store all the values after that in string till you found "Top"..............

    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading text file by line number
    By whiskedaway in forum C++ Programming
    Replies: 13
    Last Post: 06-16-2009, 10:09 AM
  2. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  3. Is there any way to read a line from a text file?
    By megareix in forum C Programming
    Replies: 13
    Last Post: 01-09-2009, 12:13 PM
  4. How do I make my edit box move text to the next line?
    By ElWhapo in forum Windows Programming
    Replies: 2
    Last Post: 01-04-2005, 10:21 PM
  5. inputting line of text vs. integers in STACK
    By sballew in forum C Programming
    Replies: 17
    Last Post: 11-27-2001, 10:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21