hi,

well it has been a while since i posted anything, but .... :)

today i'm dissatisfied with search and replace engines that many editors provide , like notpade++, UE ... well the problem is that they work perfectly when replacing is done on small dataset, but when something like this is done on a dataset that is 1GB in size.... well i'll just say THANK YOU LARRY!.

but where is the problem then, the problem is that my colleges don't do programming and i'm tired of writing these short scripts to modify their documents, so my idea was to make a short template script that they could just modify a bit and run. But after only one week this script looked like a child was hitting the keyboard with a hammer and those random commands were so pose to be lines of Perl code or something . so that was obvious 'no go'

now i decided to do a small script that the user could use from a command line like

./regex.pl Input.file '##(.*?)_kxx' 'KO$1'
to search for expression ##(.*?)_kxx and replace it with a KO$1 , therefore leaving the expression matched under (.*?).

but the problem is, i can't figure out how to pass $1 to the script for evaluation. i tried many ways but none seems to do the job. so please any hint would be more then appreciated :).

#!/usr/bin/perl use strict; while(<DATA>){ $_ =~ s/$ARGV[0]/$ARGV[1]/g; print $_; } __DATA__ |Chlre4|328957|pg._10_#_1 |Chlre4|28893|est.pg.C_80374 |Chlre5|338325|pm.pg._10_#_4
and let say i wish to do this:
regex.pl '\|(\d+)\|' "#$1#"
thnx

In reply to regex parser needed by baxy77bax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.