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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:31:30+00:00 2026-05-30T20:31:30+00:00

I have an input file with the following syntax: 00000 INFO [IVS ] reset

  • 0

I have an input file with the following syntax:

00000 INFO  [IVS ] reset receiver  
00000 INFO  [IVS ] reset transmitter  
00331 INFO  [IVS ] sync detected     

Data Required in the form

frame=0000  
info=INFO  
TYPE=[IVS ]  
message=reset receiver  

($frame,$info,$type,$message)=split(what would be the argument?);

note: space after IVS before bracket, so cant use space as the separator.

  • 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-30T20:31:31+00:00Added an answer on May 30, 2026 at 8:31 pm

    I agree with @hobbs but you should use the expanded format for complex regular expressions:

    while( my $line = <DATA> ){
      chomp $line;
    
      my ( $frame, $info, $type, $message ) = 
        $line =~ m{
          \A        # start at the beginning of the string
          (\d+)     # capture a string of digits        --> $frame
          \s+       # skip the white space
          (\S+)     # capture a string of non-spaces    --> $info
          \s+       # skip the white space
          (         # start a capture                   --> $type
            \[      #   capture an opening bracket
            [^\]]*  #   capture everything that's not a closing bracket
            \]      #   capture the closing bracket
          )         # end the capture
          \s+       # skip the white space
          (.*)      # capture the remainder of the line --> $message
        }msx;
    
      print "\$frame   = $frame\n";
      print "\$info    = $info\n";
      print "\$type    = $type\n";
      print "\$message = $message\n";
      print "\n";
    }
    
    __DATA__
    00000 INFO  [IVS ] reset receiver
    00000 INFO  [IVS ] reset transmitter
    00331 INFO  [IVS ] sync detected
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file with the following syntax in some_1.xyz module some_1 { INPUT
I have the following code: (define (get-data) (define port (open-input-file ../data/problem11.txt)) (define field 0)
I have the following target: <target name=promptforchoice> <input addproperty=choice> Copy the file?. [Y, n]
I have some data analysis code that processes an input file and outputs HTML
I have the following input file for R: car 1 car 2 car 3
I have an input file and the first line contains the following decimal. 0.5053102074297753
Let's say I have an input text file of the following format: Section1 Heading
With the following input file: rohit mohit sohit 34 45 67 I have to
I have a particular csv file with the following data: uid Business Area employeeNumber
I have the following input file that you might recognize as a debian Packages

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.