Hej Monks,
I have a problem with a file that has been melformated during some operation on a source machine. It now looks like this:
18450 0600060009 25 0 768188519 768188519
+ 0030020124 000 000 10
77019 73587 25 0 73165 7307
+40506 0160100051 029 000
74049 25 0 73950
+ 1040030047 030 000
14048 14048 25 0 11833 1183
+3 022 000
18450 0600060027 25 0 709948778 709948778
+ 0010030064 000 000 10
73330 25 0 0050312875 7702
+0 000 000
18450 0600040020 25 0 703820853 703820853
+ 0030020125 000 000 10
And I need it to looks like this
18450 0600060009 25 0 768188519 768188519
+ 0030020124 000 000 10
77019 73587 25 0 73165 730740506
+ 0160100051 029 000
74049 25 0 73950
+ 1040030047 030 000
14048 14048 25 0 11833 11833
+ 022 000
18450 0600060027 25 0 709948778 709948778
+ 0010030064 000 000 10
73330 25 0 0050312875 77020
+ 000 000
18450 0600040020 25 0 703820853 703820853
+ 0030020125 000 000 10
Now, what happened is that everything that has been melformated had shifted 5 spaces to the right for some reason. I know that bash SED would be maybe the easiest way to solve it but I just don't know how to do it. I've tried with printf, but my problem is how to read empty spaces into a variable/list.
Could you please help ?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|