Home » Infrastructure » Unix » Formating text using "cut" commond
Formating text using "cut" commond [message #97009] Mon, 22 October 2001 10:02 Go to next message
Laxsun
Messages: 10
Registered: October 2001
Junior Member
Some can please help me, how to insert a 'tab' or some
spaces between the selecte set of characters using the cut command in unix

I am using the following command:

cut -c 1-19,30-39,51-59,71-79,91-99 test.txt

Thanks in advance
Laxsun

----------------------------------------------------------------------
Re: Formating text using "cut" commond [message #97010 is a reply to message #97009] Tue, 23 October 2001 05:38 Go to previous messageGo to next message
Dinesh C Sivasankaran
Messages: 2
Registered: October 2001
Junior Member
You can try something like this ...

$ cat i
1223456767
2323456767

$ awk '{printf "%st%sn",substr($0,0,3), substr($0,4,3)}' i | more

122 345
232 345

You can change the tab (t) with other suitable delimiters you want.

Hope this would be useful .

----------------------------------------------------------------------
Re: Formating text using "cut" commond [message #97014 is a reply to message #97009] Tue, 23 October 2001 08:21 Go to previous message
Laxsun
Messages: 10
Registered: October 2001
Junior Member
Hi Dinesh,

Thanks a lot, really it is useful and helped me
in time.

thanks
Laxsun

----------------------------------------------------------------------
Previous Topic: Re: Oracle on Redhat Linux
Next Topic: sheduled export backup of all tablespace
Goto Forum:
  


Current Time: Thu Apr 18 05:56:29 CDT 2024