OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Extract multi-level bullet point contents from a tab delimited text file

  • Thread starter Thread starter Jiang Pingfei
  • Start date Start date
J

Jiang Pingfei

Guest
I have a text file containing two level bullet points in the format below and I believe it is tab delimited. This is because when I use pd.read_csv it is able to extract each bullet point.

What I would like to do is to extract all contents that belong to the first level bullet points, NOT each individual bullet point. Any ideas would be greatly appreciated.

Example:

Code:
- ABCD
  - abcd
- EFGH
  - efgh
....
...

What I would like to extract:

  1. ABCDabcd
  2. EFGHefgh

I tried regex but I can only extract he first level, i.e. ABCD, EFGH
<p>I have a text file containing two level bullet points in the format below and I believe it is tab delimited. This is because when I use pd.read_csv it is able to extract each bullet point.</p>
<p>What I would like to do is to extract all contents that belong to the first level bullet points, NOT each individual bullet point. Any ideas would be greatly appreciated.</p>
<p>Example:</p>
<pre><code>- ABCD
- abcd
- EFGH
- efgh
....
...
</code></pre>
<p>What I would like to extract:</p>
<ol>
<li>ABCDabcd</li>
<li>EFGHefgh</li>
</ol>
<p>I tried regex but I can only extract he first level, i.e. ABCD, EFGH</p>
 

Latest posts

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top