Pattern match from beginning
Posted: Fri Mar 19, 2010 5:11 pm
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."
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."