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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:00:52+00:00 2026-06-07T09:00:52+00:00

I have a csv file with records like this: ^Tablete Internet^|GoClever|^TAB I71^|^Tableta GoClever TAB

  • 0

I have a csv file with records like this:

^Tablete Internet^|GoClever|^TAB I71^|^Tableta GoClever TAB I71, InfoTMIC iMAPx220 1GHz MKV, MOV, VOB, DAT, WMV, AVI, 3GP, MP4, RM, RMVB, FLV, MKV, MOV, VOB, DAT, WMV, MP3!WAV!OGG!FLAC!APE!AAC, Conectori: 1x mini jack 3.5 mm, 2 porturi USB 2.0, 4000 mAh lithium-ion polymer 3.7V^!92.00!USD!w!24!0!Link!!^5 ron^!!|
Group|Prod|Den|Description!12!EUR!^wait time^!160!Modified!Link!^Spec Obs^!^tv none^!more!info|

I need to replace the last 10 of the “!” from the end of the row with “|” so finaly it will look like:

^Tablete Internet^|GoClever|^TAB I71^|^Tableta GoClever TAB I71, InfoTMIC iMAPx220 1GHz MKV, MOV, VOB, DAT, WMV, AVI, 3GP, MP4, RM, RMVB, FLV, MKV, MOV, VOB, DAT, WMV, MP3!WAV!OGG!FLAC!APE!AAC, Conectori: 1x mini jack 3.5 mm, 2 porturi USB 2.0, 4000 mAh lithium-ion polymer 3.7V^|92.00|USD|w|24|0|Link||^5 ron^|||
Group|Prod|Den|Description|12|EUR|^wait time^|160|Modified|Link|^Spec Obs^|^tv none^|other|info|

I’ve tried with:

sed 's/!\([^\^!]*\)!\([^!]*\)$/|\1|\2/'

but this replaces only the last 2 occurences of “!”. If I try

sed 's/!\([^\^!]*\)!\([^!]*\)!\([^!]*\)$/|\1|\2\3/'

it does not match anything… So how can I do this?

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-06-07T09:00:54+00:00Added an answer on June 7, 2026 at 9:00 am

    I know is not the most elegant solution but I’ve managed to do it with:

    perl -npe 's/^(.*)!(.*)!(.*)!(.*)!(.*)!(.*)!(.*)!(.*)!(.*)!(.*)!(.*)$/$1|$2|$3|$4|$5|$6|$7|$8|$9|$10|$11/'
    

    Thanks!

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

Sidebar

Related Questions

I have a CSV file that goes something like this: ['Name1', '', '', '',
I have a CSV file containing some user data it looks like this: 10333,,an.10,Kenyata,,Aaron,,,,,,,,,,
I have a Excel CSV files with employee records in them. Something like this:
I have a CSV file with set of records on it. While I use
I have a .csv file with records written in the following form: 2010-04-20 15:15:00,8.9915176259e+00,8.8562623697e+00
I have a CSV-like text file that has about 1000 lines. Between each record
I have a CSV file with records that need to be sorted and then
I have a data file in CSV format that has the some data like
Say I have a CSV file with 4 fields, ID,name,pay,age and about 32,000 records.
I have my CSV file imported as such: records = FasterCSV.read(path, :headers => true,

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.