Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to position part of the line after pattern (including it) after 80th character?
    primarykey
    data
    text
    <p>I know that question sounds a little odd but i will try to explain it more.</p> <p>I have a file <code>params</code> that looks like this: </p> <pre><code>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/ </code></pre> <p>What i want to achieve is to move everything after (and with) <code>$</code> to the right, ie 80th 'place' of a line:</p> <pre><code>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/ </code></pre> <p>We don't know the exact length of the string before the <code>$</code> sign. Also the space between must be filled with spaces and nothing more.</p> <p>As always i need to do it in bash 2.05 probably with sed, awk or sth like that. </p> <p>UPDATE<br> I wasn't specific about how file look like so here's more: </p> <pre><code>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 </code></pre> <p>I will not post changed version becouse it would be too long. I want <code>$[string]</code> parts to be moved to the right, but those lines without <code>$</code> thing will remain as they are.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload