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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:44:52+00:00 2026-05-20T12:44:52+00:00

I know that question sounds a little odd but i will try to explain

  • 0

I know that question sounds a little odd but i will try to explain it more.

I have a file params that looks like this:

3       p       1 1.732051 0 1.9628$/x2r_a/  
4       p       1 1.732051 0 -1.9628$/x2r_a/  
5       p       -1 1.732051 0 1.9628$/x2r_a/  
6       p       -1 1.732051 0 -1.9628$/x2r_a/  

What i want to achieve is to move everything after (and with) $ to the right, ie 80th ‘place’ of a line:

3       p       1 1.732051 0 1.9628                                   $/x2r_a/  
4       p       1 1.732051 0 -1.9628                                  $/x2r_a/  
5       p       -1 1.732051 0 1.9628                                  $/x2r_a/  
6       p       -1 1.732051 0 -1.9628                                 $/x2r_a/

We don’t know the exact length of the string before the $ sign. Also the space between must be filled with spaces and nothing more.

As always i need to do it in bash 2.05 probably with sed, awk or sth like that.

UPDATE
I wasn’t specific about how file look like so here’s more:

c ------------------
c Something stupid
c ------------------
c there is a number: 9$/ar_numb/
c a line that looks
1       px      0.9814$/r_a/
2       px      -0.9814$/r_a/
3       p       1 1.732051 0 1.9628$/x2r_a/
4       p       1 1.732051 0 -1.9628$/x2r_a/
5       p       -1 1.732051 0 1.9628$/x2r_a/
6       p       -1 1.732051 0 -1.9628$/x2r_a/
c
c dirty line
7       cz      0.9347$/x05d_a/
c very dirty
41      p       0$/A_Nel/!jl
        1$/B_Nel/!jl
        0$/C_Nel/!jl
        0$/D_Nel/!jl
        $bad element
42      p       1.723051$/A_NEel/!jl
        1$/B_NEel/!jl
        0$/C_NEel/!jl
        0$/D_NEel/!jl
        $kokode nanika kaite kudasai

I will not post changed version becouse it would be too long. I want $[string] parts to be moved to the right, but those lines without $ thing will remain as they are.

  • 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-20T12:44:53+00:00Added an answer on May 20, 2026 at 12:44 pm

    Based on kojiro’s answer to include the new requirements

    awk -F'$' '/\$/{printf("%-79s$%s\n", $1, $2);next}1' ./params
    

    Proof of Concept

    $ awk -F'$' '/\$/{printf("%-79s$%s\n", $1, $2);next}1' ./params
    c ------------------
    c Something stupid
    c ------------------
    c there is a number: 9                                                         $/ar_numb/
    c a line that looks
    1       px      0.9814                                                         $/r_a/
    2       px      -0.9814                                                        $/r_a/
    3       p       1 1.732051 0 1.9628                                            $/x2r_a/
    4       p       1 1.732051 0 -1.9628                                           $/x2r_a/
    5       p       -1 1.732051 0 1.9628                                           $/x2r_a/
    6       p       -1 1.732051 0 -1.9628                                          $/x2r_a/
    c
    c dirty line
    7       cz      0.9347                                                         $/x05d_a/
    c very dirty
    41      p       0                                                              $/A_Nel/!jl
            1                                                                      $/B_Nel/!jl
            0                                                                      $/C_Nel/!jl
            0                                                                      $/D_Nel/!jl
                                                                                   $bad element
    42      p       1.723051                                                       $/A_NEel/!jl
            1                                                                      $/B_NEel/!jl
            0                                                                      $/C_NEel/!jl
            0                                                                      $/D_NEel/!jl
                                                                                   $kokode nanika kaite kudasai
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question might sound a little bit crazy, but I tough that
My question sounds pretty weird, but my problem is that I don't know how
I know this question sounds weird, but please, let me explain myself. I'm using
I know that this is a simple question for PHP guys but I don't
Maths101 question - does anyone know how to calculate an ellipse (width/height) that will
I know that |DataDirectory| will resolve to App_Data in an ASP.NET application but is
Yes, I know it sounds weird, but it doesn't, the question is why, and
This sounds like a simple question, but I don't know how to search for
I know this question sounds very basic. But I can't find it using Google.
My question sounds like a contradiction, but I don't know how else to refer

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.