Project Detail

Search and replace  

Search and replace is project number 482631
posted at Freelancer.com. Click here to post your own project.

 

| More Free Trial For New Buyers
 

Status:

Selected Providers: wildCat

Budget: $30-250

Created: 08/04/2009 at 15:53 EDT

Bid Count: 12

Average Bid:
$ 58

08/05/2009 at 15:53 EDT

Project Creator: alanstl
Employer Rating: 10/1010/1010/1010/1010/1010/1010/1010/1010/1010/10 (1 reviews)

Bid On This Project
 

Description

Need to have a script, can be in PHP, Perl or a shell script to convert some text strings that appear in a file. They may appear any number of times in the text file

The basic pattern is <!--[gt ]--> inside there we can expect to see several params
domain, text, plural, count, category, html, tag

e.g.

<!--[gt text='hello']--> or <!--[gt text='apple' plural='apples' count='2']-->

Quotation may be with single or double quotes. The parameters can appear in any order. You only need to parse text, plural, and count

if plural is not present we need to replace the occurrence with <?php g('text'); ?>
if plural us present we need to replace the string with <?php ng('text', 'plural', 'count'); ?>
the words text, plural and count refer to the value of those parameters.

So a full example:

---START
<!--[gt text='hello']-->anything in between <!--[gt text='apple' plural="apples" count=2]-->
<!--[gt text="hello %s" tag="name"]--> more stuff<!--[gt plural="apples for %s" text='apple for %s' tag='you' html=1 count=2]-->more text and maybe some html etc.
---END

should become:

<?php g('hello'); ?>anything in between <?php ng('apple', 'apples', 2); ?>
<?php g('hello %s'); ?> more stuff<?php ng('apple for %s', 'apples for %s', 2); ?>more text and maybe some html etc.

Notice that the order when we translate is important for plurals, because we replace in the form ng(text, plural, count) even if the order was mixed up. Notice how we disregard all the other possible params.

The solution must be either a php script, perl script or shell script. Just needs to be able to read a file and output the file... nothing fancy and no interface at all. if writing in a PHP script just file_get_contents and file_put_contents is enough.


Additional information submitted:

08/04/2009 at 15:58 EDT:
Please note that the params may contain quotations marks and so on.

e.g

text='hello to "you" today'
or
text="hello to 'you' today"
or
text='hello to \'you\' today'

So the regex or whatever needs to be aware of this and other special characters that may appear.


Messages Posted:0 View project clarification board Post message on project clarification board

Bid On This Project
 

If you are the project creator or one of the bidders Log In for more options

 

80

1 day

08-04-2009 18:00 EDT

check pm please

help

 

60

1 day

08-04-2009 16:37 EDT

Hi, Please see PMB. Thanks, Dharmendra

help

 

40

0 days

08-04-2009 16:32 EDT

Can do it easily , have loads of experience with regex, string matching stuff .

help

 

30

1 day

08-04-2009 22:53 EDT

please check your pm.

help

 

100

2 days

08-04-2009 16:04 EDT

i already did two projects in perl,it's easy ,let's start

help

 

60

1 day

08-04-2009 16:25 EDT

Hi, please check the PM.

help

 

65

1 day

08-04-2009 16:36 EDT

(No Feedback Yet)

i have long experience for these. lets start with me i will give you this work with in one day

help

 

30

1 day

08-04-2009 17:12 EDT

(No Feedback Yet)

Hi. I can do it with perl.

help

 

75

1 day

08-04-2009 20:01 EDT

(No Feedback Yet)

I am interested to your project. I am a Web Developer with extensive experience PERL I have 8 years of experience in software design and development web-based cross-browser and cross-platform systems. Thanks

help

 

30

2 days

08-05-2009 01:46 EDT

(No Feedback Yet)

I am very much comfortable with Perl. So i think i can complete this within 1 day itself.But since i need to test it aganist various testcase i need half day more.

help

 

70

1 day

08-05-2009 01:52 EDT

(No Feedback Yet)

I am very much familiar with perl. Having 8 years experience in perl. Good in regular expression. Having experience in perl/cgi, mod_perl based web applications. I will complete this work within a day.

help

 

60

3 days

08-05-2009 04:11 EDT

(No Feedback Yet)

Let's start to save time.

help


    Bid on this Project