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

  • Home
  • SEARCH
  • 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 4623940
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:03:35+00:00 2026-05-22T03:03:35+00:00

Have few thousand reports that have consistently formatted tabular data embedded within them that

  • 0

Have few thousand reports that have consistently formatted tabular data embedded within them that I need to extract.

Have a few ideas, but thought I’d post to see if there’s a better way to do this than what I’m thinking; which is to extract the tabular data, create a new file for it, then parse that data as a tabular file.

Here’s a sample input and output, where the output read and written row by row to a database.

INPUT_FILE

MiscText MiscText MiscText
MiscText MiscText MiscText
MiscText MiscText MiscText
SubHeader
PASS    1283019238  alksdjalskdjl
FAIL    102310928301    kajdlkajsldkaj
PASS    102930192830    aoisdajsdoiaj
PASS    192830192301    jiasdojoasi
MiscText MiscText MiscText
MiscText MiscText MiscText
MiscText MiscText MiscText

OUTPUT (read/write row-by-row from text-file to DB)

ROW-01{column01,column02,column03}
...
ROW-nth{column01,column02,column03}
  • 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-22T03:03:35+00:00Added an answer on May 22, 2026 at 3:03 am

    Recognizing when to start processing tabular data is easy. You’ve got the marker line. The difficulty is recognizing when to stop processing data. You can apply the heuristics of stopping to process data when the split doesn’t yield the expected result.

    use strict;
    use warnings;
    my $tab_data;
    my $num_cols;
    while ( <> ) {
        $tab_data = 1, next if $_ eq "SubHeader\n";
        next unless $tab_data;
        chomp;
        my @cols = split /\t/;
        $num_cols ||= scalar @cols;
        last if $num_cols and $num_cols != scalar @cols;
        print join( "\t", @cols ), "\n";
    }
    

    Save as etd.pl (etd = extract tabular data, what did you think?), and call it like this from the command line:

    perl etd.pl < your-mixed-input.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a moderately large piece (a few thousand lines) of Python/Numpy/Scipy code that
I have an Excel spreadsheet with a few thousand entries in it. I want
I have few asynchronous tasks running and I need to wait until at least
I have a few Visual Studio Solutions/Projects that are being worked on in my
We write a Windows desktop application that is installed on a few thousand computers
I have a report that renders data returned from a stored procedure. Using profiler
I have a site map of a few thoasand pages where the only different
I have few different applications among which I'd like to share a C# enum.
I'm a newbie to pgsql. I have few questionss on it: 1) I know
How do I create subdomains in ASP.NET? I have few links on my homepage(Home.aspx)

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.