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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:39:02+00:00 2026-05-24T09:39:02+00:00

lets say I have a text file with lines as such: [4/20/11 17:07:12:875 CEST]

  • 0

lets say I have a text file with lines as such:

[4/20/11 17:07:12:875 CEST] 00000059 FfdcProvider  W com.test.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:/Prgs/testing/WebSphere/AppServer/profiles/ProcCtr01/logs/ffdc/server1_3d203d20_11.04.20_17.07.12.8755227341908890183253.txt com.test.testserver.management.cmdframework.CmdNotificationListener 134
[4/20/11 17:07:27:609 CEST] 0000005d wle           E   CWLLG2229E: An exception occurred in an EJB call.  Error: Snapshot with ID Snapshot.8fdaaf3f-ce3f-426e-9347-3ac7e8a3863e not found.
                             com.lombardisoftware.core.TeamWorksException: Snapshot with ID Snapshot.8fdaaf3f-ce3f-426e-9347-3ac7e8a3863e not found.
   at com.lombardisoftware.server.ejb.persistence.CommonDAO.assertNotNull(CommonDAO.java:70)

Is there anyway to easily import a data source such as this into protovis, if not what would the easiest way to parse this into a JSON format. For example for the first entry might be parsed like so:

[
  {
 "Date": "4/20/11 17:07:12:875 CEST",
 "Status": "00000059",
 "Msg": "FfdcProvider  W com.test.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I",
 },
]

Thanks, David

  • 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-05-24T09:39:02+00:00Added an answer on May 24, 2026 at 9:39 am

    Protovis itself doesn’t offer any utilities for parsing text files, so your options are:

    • Use Javascript to parse the text into an object, most likely using regex.
    • Pre-process the text using the text-parsing language or utility of your choice, exporting a JSON file.

    Which you choose depends on several factors:

    • Is the data somewhat static, or are you going to be running this on a new or dynamic file each time you look at it? With static data, it might be easiest to pre-process; with dynamic data, this may add an annoying extra step.

    • How much data do you have? Parsing a 20K text file in Javascript is totally fine; parsing a 2MB file will be really slow, and will cause the browser to hang while it’s working (unless you use Workers).

    • If there’s a lot of processing involved, would you rather put that load on the server (by using a server-side script for pre-processing) or on the client (by doing it in the browser)?

    If you wanted to do this in Javascript, based on the sample you provided, you might do something like this:

    // Assumes var text = 'your text';
    // use the utility of your choice to load your text file into the
    // variable (e.g. jQuery.get()), or just paste it in.
    var lines = text.split(/[\r\n\f]+/),
        // regex to match your log entry beginning
        patt = /^\[(\d\d?\/\d\d?\/\d\d? \d\d:\d\d:\d\d:\d{3} [A-Z]+)\] (\d{8})/,
        items = [],
        currentItem;
    
    // loop through the lines in the file
    lines.forEach(function(line) {
        // look for the beginning of a log entry
        var initialData = line.match(patt);
        if (initialData) {
            // start a new item, using the captured matches
            currentItem = {
                Date: initialData[1],
                Status: initialData[2],
                Msg: line.substr(initialData[0].length + 1)
            }
            items.push(currentItem);
        } else {
            // this is a continuation of the last item
            currentItem.Msg += "\n" + line;  
        }
    });
    
    // items now contains an array of objects with your data
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a modestly sized text file (~850kb, 10,000+ lines) And I
Lets say I have file with sever hundred lines of text all in capital
Let's say I have a text file that is 100 lines long. I want
Lets say I have a text file MyFile.txt with following content: hellosam whatsup mynameisjohn
Lets say I have a text file with the following data Username User ID
Lets say I have a dumb text file with the contents: Year Recon Observed
Lets say, I have the following text file: Listing 1: Endianess=little AddressModel=32 typedef struct{
I do have a file f1 which Contains some text lets say All is
Let's say I have a text file with lines like these: foo 10 bar
Lets say I have a text file, and the text file contains the following:

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.