Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7897249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:07:03+00:00 2026-06-03T08:07:03+00:00

My users want to be able to cut and paste a plain text email

  • 0

My users want to be able to cut and paste a plain text email message into Application Express, and have the content of the email parsed and populate records in a table. The email messages are typically 10,000 – 20,000 characters, so I can put the email into a VARCHAR2 or a CLOB.

What I’m asking is for guidiance / pseudocode / hints for a way to parse these emails once I’ve populated the VARCHAR2 or the CLOB.

The messages have the following format:

Item One: content for item one

Item Two: 

multiline content for item two
more multiline content for item two

*********************************    <- these asterisks are in the text
Section Header I don't care about
*********************************

Item Three: content for item three

and so on.

The item headers are known in advance, and are in a constant and defined order.

I’d prefer to do this via PL/SQL as this will be implemented in the Oracle hosted Apex instance, but I believe Java can be used there as well (PL/SQL is much preferred).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:07:05+00:00Added an answer on June 3, 2026 at 8:07 am

    The following code gives you an example of how to use instr and substr. All you need further is a way to put this code in a loop and populate l_header_first and l_header_next so you can get all the values you want.

    declare
       l_email        varchar2(32767);
       l_first        pls_integer;
       l_next         pls_integer;
       l_text         varchar2(32767);
       l_header_first varchar2(100);
       l_header_next  varchar2(100);
    
    begin
       l_email := 'Item One: content for item one
    
    Item Two: 
    
    multiline content for item two
    more multiline content for item two
    
    *********************************    <- these asterisks are in the text
    Section Header I don''t care about
    *********************************
    
    Item Three: content for item three';
    
       l_header_first := 'Item One:';
       l_header_next  := 'Item Two:';
       l_first        := instr(l_email, l_header_first) + length(l_header_first) + 1;
       l_next         := instr(l_email, l_header_next);
    
       l_text := substr(l_email, l_first, l_next - l_first);
       dbms_output.put_line('Found ' || l_header_first);
       dbms_output.put_line(l_text);
    
       l_header_first := 'Item Two:';
       l_header_next  := 'Item Three:';
       l_first        := instr(l_email, l_header_first) + length(l_header_first) + 1;
       l_next         := instr(l_email, l_header_next);
    
       l_text := substr(l_email, l_first, l_next - l_first);
       dbms_output.put_line('Found ' || l_header_first);
       dbms_output.put_line(l_text);
    
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app where we want users to be able to send us
I have a situation where I want users to be able to specify a
I have some pages that I don't want users to be able to access
I want my users to be able to drop a folder into my OSX
Our users want to be able to type in &lt;p&gt;some text goes here.</p> which
We have a client application where the users want to search notes fields for
I want users to be able to copy and paste the link of something
I want users to be able to get additional content from my website which
i have tinymce embedded in my website, so if users want to edit content,
I want users to be able to upload files via FTP to my site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.