Manipulate the text file in UNIX

Hi All,

I have a file like below and i have 2 questions on this (They are 3 lines starts with 01 , 02 and 03 . but is

01abc333644554  234 2334535 34534535355353  sfsdf345455
353 4543 jgkg tty 7676
02cdesdfsdfsdf 234 wesdfsdf 345345  234234 234234 2342342 dfgdfg
sdfgg dgdgdg fgvfs
03dfgdfg 45645 ghfhfgh 56757 sdfs sdf sdf sdf 423423  112312 545
dg456 34534 56756756 

my queries is below

  1. i want to make this text file as 3 lines instead of 6 line . ie every single line is listed as 2 lines.
  2. i want to remove the all the space and the output should be only 3 lines starts with 01 , 02 and 03 .

Thanks for your early updates

Hi Siva,
Use Code Tags.Please read forum rules.

Is this a homework assignment?

What have you tried?

What tool(s) do you want to use?

What OS (including version) and shell are you using?

Hi ,

i tried with sed for removing the space and remove the "\n" special character to make it single line
but its makes all the lines as single line instead of make one by one

 
 Linux is my OS with bash shell

I repeat: Is this a homework assignment?

Until you answer this (and explain why you need to do this if it isn't a homework assignment), we can't help you with this simple task.

This is not a home work assignement

I am working on a automation taks and its required some help to manipulate the text file.

---------- Post updated at 01:01 PM ---------- Previous update was at 12:59 PM ----------

Hi Don Cragun,

Thanks for your updates!

I no need your help on this and I can do myself to fix this.

Thanks!

I'm glad to hear you solved your problem. So other people reading this thread can learn from your question, will you show us how you fixed it?

I was going to suggest trying:

sed 'N;s/[[:space:]]//g' file
1 Like