473,386 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Formatting plain text

I want to format 5,000 lines of plain text with the easiest way possible (due to tennis elbow injury). I have no php or programming experience. Below is what I have been told it should look like. With places to add peoples names later.

Expand|Select|Wrap|Line Numbers
  1. echo "$firstname1 and $firstname2. XXX XXXXXX XXXXXX XXXX XXXXX<br />";
  2. echo "XXXXXXXXX XXXXXXXX<br />";
  3. echo "<br />";
  4. echo "XXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX XX<br />";
  5. echo "XXXXXX XXXXX XXXX XXXXXXXXX XXXXX<br />";
  6. echo "Mr. $lastname1 XXXXXXXXXXX XXX $firstname2 XXXXX<br />";
  7. echo "XXXXXXXXXXXX $firstname2 $lastname2 XXXXXXXXXXXX<br />";
and

Expand|Select|Wrap|Line Numbers
  1. fwrite($fh,"$firstname1 and $firstname2. XXX XXXXXX XXXXXX XXXX XXXXX\n");
  2. fwrite($fh,"XXXXXXXXX XXXXXXXX\n");
  3. fwrite($fh,"\n");
I hope that is enough information. (The uneditied versions match).

Is there a program that I should be using to do this formatting?

Cheers
Chris
Apr 13 '10 #1
7 1446
code green
1,726 Expert 1GB
Don't understand what you mean by format but you don't need a new function call (echo and fwrite) for every new line.
it can be done in one call only
Expand|Select|Wrap|Line Numbers
  1. echo "$firstname1 and $firstname2. XXX XXXXXX XXXXXX XXXX XXXXX<br />XXXXXXXXX XXXXXXXX<br />......."
  2.  
Where is this text coming from?
Apr 13 '10 #2
I have to put stories on a website.
Apr 14 '10 #3
That's exactly what I am looking for. I didn't know that.
"you don't need a new function call (echo and fwrite) for every new line.
it can be done in one call only"
How do I do it?
Apr 14 '10 #4
Also the inverted commas and <br />
Apr 14 '10 #5
I assume the call is added with the text already in place?
Apr 14 '10 #6
code green
1,726 Expert 1GB
How do I do it
I did post an example. Just place the <br> anywhere you like in the text I'll do it again
Expand|Select|Wrap|Line Numbers
  1. echo "$firstname1 and $firstname2. XXX XXXXXX XXXXXX XXXX XXXXX
  2. <br>XXXXXXXXX XXXXXXXX<br>
  3. <br>XXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX XX<br>";
The same idea for fwrite,
Apr 14 '10 #7
Hello. How are you today? Code Green.
This is a simple message for formatting a php page.
Cheers
Chris
Apr 14 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: TomT | last post by:
Hi, I've created a form that has a 3 fields. 2 textboxes (username & password) 1 TextArea (notes) I have linked this to an access DB. This is working well, the user enters thier Username...
0
by: Radu.Micu | last post by:
I have a RichTextBox on my form and I want to save the text that a user writes into it in a AccessDB but I want to save the formatted text not only plain txt I have seen in some programs that the...
7
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is...
2
by: John Mason | last post by:
Hi, I have a Datagrid control with an edit command column, which has a PushButton ButtonType. I am trying to apply formatting to the plain grey button, to make it look more appealing on...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
4
by: Nalaka | last post by:
Hi, I have two questions about gridViews. 1. How can I intercept the row/column values at loading to change values? 2. After I update a row (using default update functionality), how can I...
2
by: Kevin Blount | last post by:
I have a string of HTML (used for a specific purpose) that I'd like to use somewhere else but as plain text. Rather than introduce a specifically created plain text version I'd like to strip the...
3
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to...
1
by: dbuchanan | last post by:
I want to fill a textbox or a label or with lines from a listbox. I want to preserve the lline for line as it comes from the list box. I do not want the test to run-on. I suppose it is okay to wrap...
3
by: =?Utf-8?B?b24tbGluZSBqb3VybmFsIGVkaXRvcg==?= | last post by:
I can't seem to cut-and-paste text, with either .doc or .html formatting, into my .asp web-pages --all the formatting is lost. Is there some code that needs to be added to the page that will...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.