Pattern match from beginning

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
pakiyabhai
Posts: 8
Joined: Tue Feb 09, 2010 7:26 pm

Pattern match from beginning

Post by pakiyabhai »

A. I would like to check for a pattern from BEGINNING of the line only, and then delete the line.
B. Add to A+ any empty spaces/lines above it.

I am able to capture By easily by just typing By in easy pattern , but it catches by in line 1 also. News 1 has three spaces between headline and reporter , while news 2 had only 2 spaces

Delete line with Mkhululi Mancotywa , and then subsequent spaces between by and heading











So my sample data looks like ,


" South African Corn Rises, Tracking Advances by U.S. Benchmark



By Mkhululi Mancotywa
March 16 (Bloomberg) -- Corn in South Africa, the largest
producer of the grain on the continent, rose as prices gained in
the U.S., which competes for export markets in Africa.
Corn for May delivery rose 0.5 percent in Chicago trading
today, advancing for the first time since March 3.

Brazil Soybean, Corn Prices at Paranagua for March 12 (Table)


By Terry Barrett
March 15 (Bloomberg) -- Following is a table detailing cas
prices for corn, soybeans and soybean products at Paranagua,
Brazil, according to Ary Oleofar in Sao Paulo. Prices for corn
are in dollars per metric ton. All other prices are expressed
as a basis, or difference, between spot supplies and Chicago
Board of Trade futures."
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Pattern match from beginning

Post by DataMystic Support »

Try the EasyPattern

Code: Select all

[ 0+ (cr, lf) ; blank lines
 lineStart, "Mkhululi Mancotywa"
]
Replace with blank.
pakiyabhai
Posts: 8
Joined: Tue Feb 09, 2010 7:26 pm

Re: Pattern match from beginning

Post by pakiyabhai »

thank you , but can you tell me what does cr and lf mean ?

also I won't have Mkhululi Mancotywa everytime , can I have something which can capture line start "BY" and then two words after that of any lengths ?
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Pattern match from beginning

Post by DataMystic Support »

Please purchase TextPipe Lite and I will be more than happy to answer this question for you.
Post Reply