Make Paragraphs

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

Make Paragraphs

Post by pakiyabhai »

I have used textsoap on mac , with a feature which gives the option of make paragraph from the text below , there are extra spaces as you can see from the body of the text. I cannot find anything like this in Remove menu .






South African White Corn Falls as Rand Gains Against Dollar



By Mkhululi Mancotywa
March 15 (Bloomberg) -- White corn in South Africa, the
largest producer of the grain on the continent, fell as the rand
rose, cutting the cost of imports for local millers.
The rand traded at 7.3994 against the dollar at 9:25 a.m.
in Johannesburg, compared with 7.4015 at the close of trading at
noon March 12.
AnthonyFitz
Posts: 11
Joined: Mon Aug 25, 2008 9:16 pm
Location: Dublin and Manila
Contact:

Re: Make Paragraphs

Post by AnthonyFitz »

Hi pakiyabhai,

I think this is something that could be done in TextPipe.

What do you want to do exactly? Can you post the output of the text you would like to see.

Anthony.
http://www.TheLocalizer.com/
High Quality, Low Cost, Localization Engineering, Testing, Audio & Video Services
pakiyabhai
Posts: 8
Joined: Tue Feb 09, 2010 7:26 pm

Re: Make Paragraphs

Post by pakiyabhai »

From

Code: Select all

 
South African White Corn Falls as Rand Gains Against Dollar



By Mkhululi Mancotywa
March 15 (Bloomberg) -- White corn in South Africa, the
largest producer of the grain on the continent, fell as the rand
rose, cutting the cost of imports for local millers.
The rand traded at 7.3994 against the dollar at 9:25 a.m.
in Johannesburg, compared with 7.4015 at the close of trading at
noon March 12.

To

Code: Select all

South African White Corn Falls as Rand Gains Against Dollar By Mkhululi Mancotywa March 15 (Bloomberg) -- White corn in South Africa, the largest producer of the grain on the continent, fell as the rand rose, cutting the cost of imports for local millers. The rand traded at 7.3994 against the dollar at 9:25 a.m.in Johannesburg, compared with 7.4015 at the close of trading at noon March 12.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Make Paragraphs

Post by DataMystic Support »

Use an EasyPattern like this, to replace runs of spaces tabs and line breaks with a single space.

Code: Select all

[ longest 1+ (space or tab or cr or lf) ]
ie

Code: Select all

EasyPattern [[ longest 1+ (space or tab or cr or lf) ]] with [ ]
   [ ] Match case
   [ ] Whole words only
   [ ] Case sensitive replace
   [X] Prompt on replace
   [ ] Skip prompt if identical
   [ ] First only
   [ ] Extract matches
   Maximum text buffer size 4096
pakiyabhai
Posts: 8
Joined: Tue Feb 09, 2010 7:26 pm

Re: Make Paragraphs

Post by pakiyabhai »

hanks for the reply , you were close but something did go wrong , the output comes with no space at all now , something like . I did precisely what you asked me to used a replace filter with easy pattern.

Code: Select all

SouthAfricanWhiteCornFallsasRandGainsAgainstDollarByMkhululiMancotywaMarch15(Bloomberg)--WhitecorninSouthAfrica,thelargestproducerofthegrainonthecontinent,fellastherandrose,cuttingthecostofimportsforlocalmillers.Therandtradedat7.3994againstthedollarat9:25a.m.inJohannesburg,comparedwith7.4015atthecloseoftradingatnoonMarch12.
Update , in replace column i entered one single space and it worked.

Can you tell me whta does cr or lf mean & what would the perl equivalent of this command be ?
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Make Paragraphs

Post by DataMystic Support »

Glad you realized you had missed the space in the replacement!

CR is a carriage return. LF is a line feed. TextPipe hides these details for you - you don't need to know the technical details at all when you use EasyPatterns in TextPipe.
Raresed84
Posts: 1
Joined: Thu Feb 25, 2010 9:28 pm
Location: Romania
Contact:

Re: Make Paragraphs

Post by Raresed84 »

thanks for this post...it was time to fix this problem:)
pakiyabhai
Posts: 8
Joined: Tue Feb 09, 2010 7:26 pm

Re: Make Paragraphs

Post by pakiyabhai »

there is a small error which I am facing with this now .

This seems to remove ALL the spaces between the paragraphs as well and my news becomes one long string.

Can I modify this to respects paragraphs or maybe 2 spaces ?
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Make Paragraphs

Post by DataMystic Support »

PLease attach the filter as a zip file, with sample text in the Trial Run area.
Post Reply