The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



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.

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 06:54 AM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 08:12 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 06:06 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl SuSE 5 07-30-2007 08: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 09:44 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-14-2008
sharif sharif is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 40
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.....
  #2 (permalink)  
Old 10-14-2008
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,754
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
sharif sharif is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 40
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?
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 On




All times are GMT -4. The time now is 08:10 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-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0