Jump to content

Check a blank line while reading a file


kb0000

Recommended Posts

I want to read a file abc.txt

 

It has contents in the format

 

This is line 1.

 

This is line 3. Further in this line.

This is line 4.

 

This is line 6.

 

I want to read this file (line by line, i think) and check if the current line is blank (like there is no Line 2 i.e. a blank line.)

 

What I want to do is that - now in the above text file there are 3 sets of line or 3 paragraphs. I want to check if there is a blank line between two set of lines.

Or is there some way to fetch paragraphs???

 

I want to separate these 3 sets of line in 3 rows in an excel sheet.

i.e.

In excel sheet columns:

A1 - This is line 1.

A2 -This is line 3. Further in this line.

This is line 4.

A3 -

This is line 6.

 

How I can do this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.