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 8163609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:06:09+00:00 2026-06-06T19:06:09+00:00

I have a text file dump that I need to convert to a delimited

  • 0

I have a text file dump that I need to convert to a delimited file. The file contains a series of “records” (for lack of a better word) formatted like this:

User: abc123 
Date: 7/3/12
Subject: the foo is bar
Project: 123456
Problem: foo bar in multiple lines of text
Resolution: foo un-barred in multiple lines of text

User: abc123 
Date: 7/3/12
Subject: the foo is bar
Project: 234567
Problem: foo bar in multiple lines of text
          which may include <newline> and 
          extend to multiple lines of text
Resolution: foo un-barred in multiple lines of text

...

Right now, with Java, I’m using StringBuffer to read this file line-by-line, parsing the lines to individual fields based on a series of if(inputLine.toLowerCase().startsWith("user:")) logic to output a final delimited line to a text file.

However, the fields Problem and Resolution are free form and may be multi-line. I’m trying to do something that would create two Strings: append all lines following Problem: and ending at Resolution: and append all lines starting after Resolution: and ending at Form:.

I’ve alerady viewed this link and this link, which suggest that StringBuilder might be an appropriate way to do this…however, I’m not quite sure how to construct the logic.

EDIT:
Since I’m reading line-by-line, I’m having a hard time wrapping my head around how to code

<pseudocode>
If the line starts with "Problem" extract the charactes after "Problem" else
if the PRIOR line starts with "problem" and the current line doesnt start with "resolution" then append characters in line to prior line
etc.
</pseudocode>

but then, if there’s a third line of “Problem…? I just can’t visualize how to make it work.

Any ideas or alternate methods of achieving my desired results?

  • 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-06T19:06:10+00:00Added an answer on June 6, 2026 at 7:06 pm

    Hi if I understand your problem correctly then something along these lines should work:

        StringBuilder problemDesc = new String....;
        if(inputLine.toLowerCase().startsWith("problem:")){
           problemDesc.append(inputLine);
           while(!inputLine.toLowerCase().startsWith("resolution:"){
               //read next line into inputline;
               problemDesc.append(inputline);
           }
           //deal with problem description here and inputLine now has the line with
           //Resolution in it Repeat same logic for retrieving the resolution value
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file dump that I need to convert to a delimited
I have a text file that contains a data dump from a database. This
I have Text file that contains data separated with a comma , . How
Ok so I have a text file that will change regularly that I need
I have a text file that is formatted like JSON, but in a print/view
I have text file with some stuff that i would like to put into
I have text file with some text information and i need to split this
I have a text file that I want to edit by rewriting it to
I have a text file which was originally a mysql dump of a database
I have text file with 5 strings. I need to use NSURLConnection to get

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.