Sort code Replace !

General discussions about Advanced Find and Replace
Post Reply
zootycoonvn
Posts: 13
Joined: Mon Aug 20, 2007 9:25 am

Sort code Replace !

Post by zootycoonvn »

I have 1000 line in file txt:

1/Such as :

Apr 2008
Aug 2007
Aug 2008
Aug 2010
Dec 2008
Dec 2009
Feb 2008
Result :
04 2008
08 2007
08 2008
08 2010
12 2008
12 2009
02 2008

Code :
Search----Replace
Jan---01
Feb---02
.......
Nov---11
Dec---12
Code is very row,i want it only 1 row.

2/Such as :
Apr 2008---Good---Eat
Aug 2007---Great---Drink
Aug 2008---Happy---Play
Aug 2010---Hope---Kiss
Dec 2008---Car---like
Dec 2009---Moto---hihi
Feb 2008---Bus---Cheap

Result :
G---04 2008---Good---Eat
G---08 2007---Great---Drink
H---08 2008---Happy---Play
H---08 2010---Hope---Kiss
C---12 2008---Car---like
M---12 2009---Moto---hihi
B---02 2008---Bus---Cheap

Plzz help me.Thankz

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: Sort code Replace !

Post by Abacre »

You have to solve the problem in two steps.

2st step:

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
(\w+ \d+---)(\w)

Replace with:
$2---$1$2

The result will be:
G---Apr 2008---Good---Eat
G---Aug 2007---Great---Drink
H---Aug 2008---Happy---Play
H---Aug 2010---Hope---Kiss
C---Dec 2008---Car---like
M---Dec 2009---Moto---hihi
B---Feb 2008---Bus---Cheap

2nd step:
Replace all months by numbers. You may uncheck "Use regular
expressions" and check "Whole Words Only".
Then you simply create a batch grid like this:

Search For:
Jan
Replace With:
01

Search For:
Feb
Replace With:
02

and so on for all 12 months.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

zootycoonvn
Posts: 13
Joined: Mon Aug 20, 2007 9:25 am

Re: Sort code Replace !

Post by zootycoonvn »

Thanks.
But it is complex.
Have way other ?
If ex2 is :
2/Such as : find first of : xxxx
Apr 2008---like---1ood---Eat
Aug 2007---like---1rea---Drink
Aug 2008---Eat---3app---Play
Aug 2010---mary---4ope---Kiss
Dec 2008---like---2452---like
Dec 2009---like---3456---hihi
Feb 2008---like---2usy---Cheap

Result :
1---Apr 2008---like---1ood---Eat
1---Aug 2007---like---1rea---Drink
3---Aug 2008---Eat---3app---Play
4---Aug 2010---mary---4ope---Kiss
2---Dec 2008---like---2452---like
3---Dec 2009---like---3456---hihi
2---Feb 2008---like---2usy---Cheap

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: Sort code Replace !

Post by Abacre »

I think this is almost the same case as previous. You can do it yourself.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

zootycoonvn
Posts: 13
Joined: Mon Aug 20, 2007 9:25 am

Re: Sort code Replace !

Post by zootycoonvn »

Roman wrote:I think this is almost the same case as previous. You can do it yourself.
Plzz help me ex a like me config.
I develop it rest require of me.
So i write question & wait u rely.


Many thanks for support from Roman.

Plzz help me it :
2/Such as : find first of : xxxx
Apr 2008---like---1ood---Eat
Aug 2007---like---1rea---Drink
Aug 2008---Eat---3app---Play
Aug 2010---mary---4ope---Kiss
Dec 2008---like---2452---like
Dec 2009---like---3456---hihi
Feb 2008---like---2usy---Cheap

Result :
1---Apr 2008---like---1ood---Eat
1---Aug 2007---like---1rea---Drink
3---Aug 2008---Eat---3app---Play
4---Aug 2010---mary---4ope---Kiss
2---Dec 2008---like---2452---like
3---Dec 2009---like---3456---hihi
2---Feb 2008---like---2usy---Cheap

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: Sort code Replace !

Post by Abacre »

The solution is:

Search for:
(\w+ \d+---\w+---)(\w)

Replace with:
$2---$1$2
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

zootycoonvn
Posts: 13
Joined: Mon Aug 20, 2007 9:25 am

Re: Sort code Replace !

Post by zootycoonvn »

Thanks Roman vey much.
Best wishes !

Post Reply