Merge Lines into Single line
Hi
I need help in merging lines Currently this is what i have a file with below output. REPLICAT REP01 Last Started 2015-09-29 11:02 Status RUNNING INTEGRATED Checkpoint Lag 00:00:00 (updated 00:00:07 ago) Process ID 7315 Log Read Checkpoint File ./dirdat/t1000274 2015-09-30 21:13:26.027860 RBA 10581838 Process ID 22834 Log Read Checkpoint File ./dirdat/t3000001 2015-09-30 21:10:01.191599 RBA 28232246 --Finally i need like below. Code:
REPLICAT REP01 Last Started 2015-09-29 11:02 Status RUNNING INTEGRATED Checkpoint Lag 00:00:00 (updated 00:00:07 ago) Log Read Checkpoint File ./dirdat/t1000274 2015-09-30 21:13:26.027860 RBA 10581838 |
Your output seems to be missing some lines that are in the input - can you redo and put both i/p and o/p recs inside CODE blocks
Thank you |
Are these lines for the most part the same (same number of columns and such)?
If so, making a macro with vi(m) and recording the sequence of events for one line and repeating for all others would be fairly easy. |
Also, where is your attempt at solving this problem?
|
Yes, you can do that, in a LOT of different ways depending on how much you want to fine-tune things. But, anyway... given this infile:
Code:
REPLICAT REP01 Last Started 2015-09-29 11:02 Status RUNNING Code:
$ cat merged.txt Check these out: https://lmddgtfy.net/?q=bash%20merge...o%20one%20line Best regards, HMW |
Thanks mates. I need this below.
I need to wriste some script to GoldenGate... I have a file with below info ================================================================================================== Code:
REPLICAT REP01 Last Started 2015-09-29 11:02 Status ABENDED from the above i need output like below. Code:
REPLICAT REP01 Last Started 2015-09-29 21:36 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:08 ago) Log Read Checkpoint File ./dirdat/R1000131 2015-10-02 17:33:14.021156 RBA 11917019 |
Your input and output don't match.
Do you really want to switch REP01 to REP02? If not, then see my previous post. With your (ambigous) example file, I get this output from my script: Code:
REPLICAT REP01 Last Started 2015-09-29 11:02 Status ABENDED Checkpoint Lag 00:00:09 (updated 33:30:41 ago) Log Read Checkpoint File ./dirdat/t1000274 2015-10-01 12:24:46.959298 RBA 17573036 However, if you want to merge, check out: Code:
man tr HMW |
All times are GMT -5. The time now is 07:43 PM. |