Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google site



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-14-2008
Registered User
 

Join Date: Feb 2007
Posts: 41
tr command for \n to \t

Hi,
How can I transfer the newline char in to tab char?.

For eg.
The text file's content is like this.
123456
xyz\123\kkk.txt

I wanna change like below.
123456 xyz\123\kkk.txt

Please help regarding this.....
Sponsored Links
  #2 (permalink)  
Old 10-14-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,169

Code:
tr -s '\n' '     ' < filename

the ' ' is the result of hitting the tab key on your keyboard, surrounded by tic marks
  #3 (permalink)  
Old 10-15-2008
Registered User
 

Join Date: Feb 2007
Posts: 41
tr command

Hi Jim,
It's working fine for a single line. How can I apply this same for multiple lines. For eg. 10000 lines.

I tried, But the output was incorrect.
Can u help me?
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
assign a command line argument and a unix command to awk variables sweta_doshi Shell Programming and Scripting 0 08-08-2008 07:54 AM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 09:12 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 07:06 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl SuSE 5 07-30-2007 09:26 AM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr Shell Programming and Scripting 0 09-19-2006 10:44 PM



All times are GMT -4. The time now is 02:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0