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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:11:42+00:00 2026-05-24T13:11:42+00:00

I’m asking for the wisdom of the stackoverflow community. I’m working on a test

  • 0

I’m asking for the wisdom of the stackoverflow community. I’m working on a test given to me. I’m using C#, I need to read in a text file that contains commercial flight information. This text file is as follows:

 1   AA2401  F7 A4 Y7 B7 M7 H7 K7 /DFW A LAX 4  0715    0836  E0.M80 9 3:21 
 2  AA2421 F7 A1 Y7 B7 M7 H7 K7 DFWLAX 4  1106    1215  E0.777 7     3:09
 3UA:US6352  B9 M9 H9 K0 /DFW 1 LAX    1200  1448  E0.733       1:48
 4   AA2407  F7 A6 Y7 B7 M7 H7 K7 /DFW A LAX 4  0820    0936  E0.757 6 3:16 *
 5   UA 499  F7 Y9 B9 M9 H9 Q9 V9 /DFW B LAX 7  0840    0959  E0.319 4 3:19
 6   UA 448  M9 H9 Q9 V9 /DFW 1 LAX    1200  1448  E0.733 8     1:48 /
 7UA:US6376  B9 M9 H9 K9 /DFW 1 LAX    1315  1603  E0.735       1:48
 8  AA2883 F7 A6 Y7 B7 M7 H7 K7 DFWLAX 4  1215    1328  E0.757 9     3:13
 9UA:US6440  B9 M9 H9 K9 /DFW 1 LAX    1445  1732  E0.735       1:47 /E
10   UA1584  M9 H9 Q9 V9 /DFW   LAX    1445  1732  E0.735 9     1:47
11   UA1082  M9 H9 Q9 V9 /DFW   LAX    1450  1735  E0.735 8     1:45
12   UA 662  M9 H9 Q9 V9 /DFW 1 LAX    1315  1603+1E0.735 N     1:48 /E
13   DL 333  F9 A9 Y9 B9 M9 H9 Q9 /DFW E LAX 5  0930    1046  E0/738 8 3:16
14   AA2413  F7 A7 Y7 B7 M7 H7 K7 /DFW A LAX 4  1008    1124  E0.757 8 3:16
15  DL1435 F9 A9 Y9 B9 M9 H9 Q9 DFWLAX 5  1130    1250-1E0/738 9     3:20
16UA:US6392  B9 M9 H9 K9 /DFW   LAX    1450  1735  E0.735       1:45
17   F9 436  B4 Y4 K4 M4  DFW 1 LAX    1525  1810+1E0.733       1:45 *
18   HP 497  W4 B7 Q7 L7  DFW 1 LAX    1700  1943+1E0.319 N     1:43

Given this text file, the information contains the following columns:

LineNumber
Carrier
OperatingCarrier
FlightNumber
Classes
DepartureAirport
ArrivalAirport
DepartureTime
ArrivalTime
ArrivalTimeShift
Equipment
Ontime
Duration

I also given these two examples:

For Line 3:
3          LineNumber
UA        Carrier
US        OperatingCarrier
6352     FlightNumber
BMHK   Classes
DFW      DepartureAirport
LAX     ArrivalAirport
1200     DepartureTime
1448     ArrivalTime
           ArrivalTimeShift
733       Equipment
           Ontime
1:48      Duration


For line 18:
18         LineNumber
HP        Carrier
           OperatingCarrier
497       FlightNumber
WBQL   Classes
DFW      DepartureAirport
LAX     ArrivalAirport
1700     DepartureTime
1943     ArrivalTime
+1        ArrivalTimeShift
319       Equipment
N          Ontime
1:43      Duration

I was also directed to make use of regular expressions. Trying to parse this has been a nightmare due to the variance in each line, especially with the spaces. I’m just looking for ideas on how to start tackling this beast. I know I can get rid of the /’s, the :’s, and the *’s.

Thanks.

  • 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-24T13:11:44+00:00Added an answer on May 24, 2026 at 1:11 pm

    Take it a step at a time. For example:

    `^`         start of line
    ` *`        possible leading spaces
    `(\d+)`     capture the LineNumber
    ` *`        possible spaces
    `([A-Z]+)`  capture the Carrier
    

    and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.