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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:51:47+00:00 2026-05-11T14:51:47+00:00

I have a bunch of lines that I’d like to split into two columns,

  • 0

I have a bunch of lines that I’d like to split into two columns, and get the data from each column. The data looks something like this:

current_well.well_number current_well.well_name current_well.well_type_code well_location.section well_location.range 

Essentially what I’d like to do is split the line based off of the period, turn the data into two columns, and then grab the data for each column. I know this can be done in Excel, but I’m really interested in VIs solution for this problem. I know that

%s/\./ 

will format the string with empty spaces. But once I have the data looking like:

current_well    well_number current_well    well_name current_well    well_type_code well_location   section well_location   range 

How do I grab all the values for each column so I can paste it into another application?

  • 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. 2026-05-11T14:51:48+00:00Added an answer on May 11, 2026 at 2:51 pm

    I’ve run into this problem a number of times. Changing the dots to tabs will line them up mostly nice, but not really. It’s true that all the columns will start on a tabstop, but there’s no guarantee that they’ll be on the same tabstop. For instance, if this was your original text:

    lt1tab.value1 gt1tabstop.value2 

    and you do:

    %s/\./\t/g 

    and assuming a tabstop is 8 spaces, you’ll get:

    lt1tab  value1 gt1tabstop    value2 

    What you might want to do instead is remove everything but the last column (or whichever column you want). For instance:

    %s/^.*\.// 

    will leave you with:

    value1 value2 

    Which you can easily copy and paste.


    If you don’t have to use Vim, you can use unix’s cut to do what you want:

    cut -f2 -d. input_file > output_file 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of XML that has lines that look like this <_char
I have a file that I read from, it contains a bunch of lines
I have 3000+ lines of javascript that I need to get into a sensible/maintainable
I have a bunch of lines like this on my app UIColor *myColor =
I have a bunch of files that I need to look at. All lines
I have a bunch of CSS files that get loaded on every page (header,
I have a bunch of lines like these: John Smith Jane Doe Dr. Bruce
I have a bunch (hundreds) of files that are supposed to have Unix line
I have a file with a bunch of lines. I have recorded a macro
I have a bunch of files that I need to be able to transport

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.