473,785 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

splitting text into pages

I'm building a site where I need to pull very large blocks from a database.

I would like to make navigation a little more user friendly by splitting
text in pages which can then be navigated. I know how to split a string in
chunks, but I need to find a method to make sure the text isn't split in the
middle of a word.

Any ideas?

Thanks,
..soma
Jul 17 '05 #1
3 2077

"somaBoy MX" <no**@nonesuch. net> wrote in message
news:40******** **************@ news.skynet.be. ..
I'm building a site where I need to pull very large blocks from a database.
I would like to make navigation a little more user friendly by splitting
text in pages which can then be navigated. I know how to split a string in
chunks, but I need to find a method to make sure the text isn't split in the middle of a word.

Any ideas?

Thanks,
.soma


string wordwrap ( string str [, int width [, string break [, boolean
cut]]]);

HTH
Garp
Jul 17 '05 #2
On Tue, 30 Mar 2004 17:13:58 +0200, "somaBoy MX" <no**@nonesuch. net> wrote:
I'm building a site where I need to pull very large blocks from a database.

I would like to make navigation a little more user friendly by splitting
text in pages which can then be navigated. I know how to split a string in
chunks, but I need to find a method to make sure the text isn't split in the
middle of a word.


The \b pattern match ('word boundary') of preg_match might be of use.

--
Andy Hassall <an**@andyh.co. uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #3
somaBoy MX wrote:
I'm building a site where I need to pull very large blocks from a database.

I would like to make navigation a little more user friendly by splitting
text in pages which can then be navigated.
Commendable, I think.
I know how to split a string in chunks, but I need to find a method to make
sure the text isn't split in the middle of a word.


Just as it is mid-word, it'd be peculiar to split the text mid-
sentence or mid-paragraph; splitting mid-passage or mid-chapter may
be less off-putting for readers. Don't split up a single train of
thought. How to split the text depends on how it's marked-up.

--
Jock
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3307
by: Sandman | last post by:
I am splitting a text block into paragraphs, to be able to add images and stuff like that to a specific paragraph in a content management system. Well, right now I'm splittin on two or more newlines, so this text block: Hello, my nickname is Sandman and I am coding some PHP Call me
9
1872
by: amitavabardhan | last post by:
How Can I extract multiple tiff images into single images through asp programming? Is there any free dll's that I can use in ASP to split multiple tiffs into single tiffs? Any suggestion regarding this issue will be highly appreciated.....
4
2710
by: guitarromantic | last post by:
Hey everyone. Following advice found online, I figured out a basic way of splitting a long article into several pages, by exploding out from a <!--pagebreak--> code in my $content field. http://www.scenepointblank.com/matt/dev/features/index.php?id=1&page=1 Sample above. The next/previous links were built with simple values:
7
1889
by: Alec | last post by:
After trial, error, 2 days reading about PHP and some fine Single Malt, have finally created a search from a database with multiple criteria as below. NOTE comments on tidying the code up are welcomed. BUT.... if I want to split the search into groups of 10 and then (like Google) prompt for page 2 of 10, 3 of 10 etc. Anyone know of any tutorials on this?
1
1743
by: Andy Britcliffe | last post by:
Hi I'm faced with the situation where I could have a single physical file that could contain multiplie XML documents e.g file.txt contains the following: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE doc SYSTEM "1.0b.dtd"> <doc transmission-date="20050715T154340Z" >
0
1114
by: just.an.imbecile | last post by:
Hello all, I am writing code for a website that has already been designed. After having written most of the code behind, my boss decides that the ..aspx page needs to be split into 4 pages with next buttons linking them. The markup guy sent me 4 new pages w/ the same field ID's, but simply split into 4 pages. He also told me that he wants the markup guy to be able to make changes to the interface with minimal changes in the code...
2
1773
by: Jenny | last post by:
Hello All! I have a long XML file that I should transmit to other computer using http. Problem is that the whole XML Document is too large for one transmitting. What is the nicest way to split XML document into smaller pieces e.g. to 10 pieces? XML document is same kind what comes to itäs tags.
3
1967
by: jb | last post by:
Am using the 'Web Application Project' model for an asp.net web app. Sections of this now need to be reusable. Is it possible to split into sub projects? What happens with /bin directory if so - are there bins in each subproject? What happens with sessions? Thanks JB
0
1615
by: raj | last post by:
My Zope based application for a client has to generate annual audit reports with too wide tables of account-wise payment details. I turned to reportlab when HTML formatting became a headache for me. Reportlab doc claims it can split by row as well as column but doesn't explain how to. Then I came to learn that reportlab does not implement byCol splitting. But is there a way out for me to split my wide data table into pages? What if I try...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.