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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:01:47+00:00 2026-05-25T03:01:47+00:00

I want to read the columns in a file where the separator is :

  • 0

I want to read the columns in a file where the separator is :.

I tried it like this (because according to http://www.asciitable.com, the octal representation of the colon is 072):

$ echo "a:b:c"  | perl -a -072 -ne 'print "$F[1]\n";' 

I want it to print b, but it doesn’t work.

  • 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-25T03:01:47+00:00Added an answer on May 25, 2026 at 3:01 am

    Look at -F in perlrun:

    % echo "a:b:c" | perl -a -F: -ne 'print "$F[1]\n";'
    b
    

    Note that the value is taken as regular expression, so some delimiters may need some extra escaping:

    % echo "a.b.c" | perl -a -F. -ne 'print "$F[1]\n";'
    
    % echo "a.b.c" | perl -a -F\\. -ne 'print "$F[1]\n";'
    b
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I read data from a file if my file is like this
I want to read a CSV file's columns directly into variables. The result should
I want to read each of the 4 columns stored in a .txt file
I have a text file. I want read that file. But In that if
I want to read lines from a file into a Set or List. Is
I want to read the registry to find the current PowerPoint version. However this
I want to read an existing PDF file, get not only the text, but
I want to read data about MMORPG characters from a .txt file and then
I have a simple tab-separated text file that I want Ruby to read every
I want to read from an excel file in C. The excel 2007 file

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.