I am trying to use looping to indent paragraphs in a file. So I need to insert blanks at the beginning of each paragraph, to do so I will need to know where the paragraph starts and it says that there is a blank before each paragraph. I need to know how do I tell the program to find those blank lines.
Please help!
Thanks
5 1852 oler1s 671
Recognized Expert Contributor
If you're having trouble figuring out the code, start with your logic. Describe in plain english your logic in indenting paragraphs. As if you were explaining to another human being. But be very precise.
If you're having trouble figuring out the code, start with your logic. Describe in plain english your logic in indenting paragraphs. As if you were explaining to another human being. But be very precise.
that's what I did in my algorithm, "find the end or a paragraph or find a blink line" but what I don't know is a code for finding the blank lines or maybe the end of a paragraph
oler1s 671
Recognized Expert Contributor
Really. So if I type in a few paragraphs, and I found the end of a paragraph, all the paragraphs would suddenly become indented? Forget about code. Just forget about it. You need to get a realistic algorithm. Every step. In plain english. I give you a bunch of paragraphs, don't just say find a paragraph. What is a paragraph? What do you mean by find? Break it down into very basic steps. You can't hope to code something you can't even describe in plain words.
pbmods 5,821
Recognized Expert Expert
Heya, bigpaco.
You're saying that you know a paragraph because the line directly before it will be empty. Is that correct?
For example: -
Is this a paragraph? It's the first line in the string.
-
-
This is a paragraph because the line above it is blank, but
-
this is not a paragraph because the line above it is not blank.
Heya, bigpaco.
You're saying that you know a paragraph because the line directly before it will be empty. Is that correct?
For example: -
Is this a paragraph? It's the first line in the string.
-
-
This is a paragraph because the line above it is blank, but
-
this is not a paragraph because the line above it is not blank.
Yes that right before each paragraph there is a blank line
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: dan glenn |
last post by:
Hi. I'm finding that if I have text entered into a
<textarea ...> </textarea> in a form, and that text
has leading blank lines (with no spaces or anything
else), that when I retrieve the entered text, I
lose the leading blank line. Each time it goes through
a post any top-leading blank line is lost. Only one-
if I have several blank lines in a row at the top,
only the first is lost. (If the top blank line has
a single space, it's handled...
|
by: Ruben |
last post by:
Hello.
I am trying to read a small text file using the readline statement. I
can only read the first 2 records from the file. It stops at the blank
lines or at lines with only spaces. I have a while statement checking
for an empty string "" which I understand represents an EOF in Python.
The text file has some blank lines with spaces and other with blanks.
Thanks a lot.
|
by: puzzlecracker |
last post by:
I want to read lines and skip blank lines:
would this work considering the lines can contain tabs, spaces, etc.?
file.in:
------
line1
line2
|
by: Melissa |
last post by:
Does anyone have a generic procedure for adding blank lines to reports like
Sales details, PO details and/or Orders details. The procedure would need to
count the number of line items, determine the remaining page to fill and
print blank lines with the same number of fields as the line items. In
addition, if there were a long list of line items that carried over to a
second and possibly more pages, to print blank lines at the last page. The...
|
by: Ryan S |
last post by:
I am trying to read an XML document generated by a web server using the
XMLTextReader class, but the document generated appears to have some blank
lines at the top that are causing problems.
If I connect directly to the URL, when I call the ".Read" method on the
XMLTextReader, I get the message:
"The XML declaration is unexpected. Line 8, Column 3"
If I open the URL in my browser and copy and paste the XML stuff (starting
| |
by: Jeff Calico |
last post by:
Hello everyone
I am transforming an XML document to text, basically only outputting
a small portion of it. When I run the following XSLT via Xalan's
processor,
I get a bunch of unwanted blank lines in the output.
Here is a simplified XML and XSLT:
(Note the problem does not happen when testing in XMLSpy)
- - - - - - - - - - - - - - - - - - - - - - - -
|
by: satya.mahesh |
last post by:
Hi All,
I am working on a problem which "eliminates blank lines in export
(between headings and when a heading is empty)". I want a macro which
will do this job for me. For e.g:
Heading1
Heading2
|
by: DAnne |
last post by:
Hi,
I have checked your archives but have not been able to find anything that works for my situation. I have a for loop that brings back a list of unique responses for each section in a report. These responses are responses to each question in a particular section.
This is working fine. However the output prints many blank lines. I have determined that these lines are are actually places where the question had the same response as a...
|
by: Andreas Bauer |
last post by:
Hi,
I have to audit some c# code. I know in the options I can adjust how
the code should be formatted while entering it. But is there any way to
apply afterwards a code template to the classes to adjust their
appearance (except ctrl-k ctrl-f)? Foremost how to clear unnecessary
blank lines, e.g reduce 4 blank lines to one. I don´t want to change
every class manually.
Thanks in advance for any hint.
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |