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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:32:43+00:00 2026-06-14T00:32:43+00:00

I have a text with 9 columns opened in the vi-editor and I like

  • 0

I have a text with 9 columns opened in the vi-editor and I like to replace the tab characters in the 9th column (the last one) with a comma, followed by a space. So far I came up with this;

'2,$s#\(^.\{8\}\)\\t#\1\(\,\)#'

but that doesn’t seem to match anything… It could be that I escaped something too much, but also I don’t know if you need to specify the column delimiter (in this case also a tab).
Any help on this one would be greatly appreciated.

  • 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-06-14T00:32:44+00:00Added an answer on June 14, 2026 at 12:32 am
    %s/^\(\%(\t\?[^\t]\+\)\{8\}\)\t\(.*\)$/\1, \2/
    

    This replaces (s):

    • ^ – start of the line
    • \( start of (group 1)
      • \%( start of inner group
        • \t? 0 or more Tabs (to account for the lack of a Tab at the start of the line)
        • [^\t]\+ followed by 1 ore more non-Tabs
      • \) end of inner group
      • \{8\} the above inner group repeated 8 times
    • \) end of (group 1)
    • \t followed by a Tab
    • \(.*\) and whatever else (group 2)
    • $ until the end of the line

    with:

    • \1 – (group 1) (everything up until the 8th Tab)
    • ,  – a comma and a space
    • \2 – (group 2) (everything from the 8th Tab until the end of the line)

    in the whole buffer (%).

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

Sidebar

Related Questions

I have two text files with various columns, each column is separated by a
I have a text file containing 5 columns of data. The first column contains
I have a text file with tab delimited data spread across 16 columns. I
I have a table with 3 columns ---QID---TEXT---CID--- I would like to find 20
I have two columns in my NSOutlineView. One is a Text and image cell
I have a text column in one of my MS Access tables that is
I often have text in columns and need to replace some things without clobbering
I have a tab-delimited text file that I am parsing. Its first column contains
I have 2 TEXT columns 'initial_time' and 'final_time' that contains values like '01:00', '16:30',
I have following query select * from table1 if table1 contains text type column/columns

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.