multiple changes on multiple lines

Discussion in 'Perl Misc' started by Dave, Apr 2, 2005.

  1. Dave

    Dave Guest

    Hello

    I would appreciate tips where I can find a base for re programming or
    where a can buy perl script with this functions

    I have a file that need multiple changes on multiple lines


    replaceblock.pl FileToChange.txt blockreplace.txt

    example FileToChange.txt

    line 1 /*
    line 2 [00.893]
    line 3 text2
    line 4 text3
    line 5 /* explanation
    line 6 /* text
    line 7 text [0.456.] text
    line 8 text8
    line 9 test ("text9"), text [35.989 , 67.88 , 33.02]
    line 10 text text text
    line 11 text [2.5] text
    line 12 text 55
    line 13 text and numbers with programming symbols....
    line 14 text14

    example blockreplace.txt

    [start block] /* replacing line 2 and 3
    [00.893]
    text2
    [end block]
    [start replace block]
    [2.15]
    text2 with more text
    [end replace block]

    [start block] /* replacing line 9, 10 and 11
    test ("text9"), text [35.989 , 67.88 , 33.02]
    text text text
    text [2.5] text
    [end block]
    [start replace block]
    test ("texzz9"), tezz [15.00 , 60.00 , 30.00]
    tezz tezz tezz
    [end replace block]

    [start block]...... "numbers of blocks change from file to file"


    newbie in perl

    Ihave made a script 7 years ago, and havent used perl since.

    Thanks

    /Dave
    Dave, Apr 2, 2005
    #1
    1. Advertising

  2. Gunnar Hjalmarsson, Apr 2, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack
    Replies:
    9
    Views:
    2,636
  2. Joe Wright
    Replies:
    0
    Views:
    496
    Joe Wright
    Jul 27, 2003
  3. lovecreatesbeauty

    How to know two lines are a pare parallel lines

    lovecreatesbeauty, Apr 27, 2006, in forum: C Programming
    Replies:
    11
    Views:
    639
    Old Wolf
    Apr 28, 2006
  4. Replies:
    1
    Views:
    437
    Jonathan Mcdougall
    Dec 6, 2005
  5. Cah Sableng
    Replies:
    0
    Views:
    230
    Cah Sableng
    Apr 23, 2007
Loading...

Share This Page