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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
split files into specified number of output files Migrainegirl UNIX for Dummies Questions & Answers 4 05-13-2008 09:38 AM
paste several files tonet Shell Programming and Scripting 1 10-05-2007 10:08 AM
paste 2 files ( it is possible???) mig28mx UNIX for Dummies Questions & Answers 3 06-21-2007 11:51 AM
Paste the files contents differently er_aparna Shell Programming and Scripting 1 05-16-2007 04:29 AM
How to output the difference of two files? yxiao UNIX for Dummies Questions & Answers 4 01-26-2004 01:55 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 01-08-2007
alexcol alexcol is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 31
Cool Need a Help with paste 2 files since the output is not what i want

Need a Help with paste 2 files since the output is not what i want ie: i have 2 files

pwd
/home/pavargaz/alejo/scan01/nokia/2006/abril/bavaria/chu0
$ cat filechu
chu0

dia Cantidad

01 257
02 262
03 260
04 58

$pwd
/home/pavargaz/alejo/scan01/nokia/2006/abril/bavaria/chu1
$ cat filechu
chu1

dia Cantidad

01 257
02 262
03 260
04 283
05 253
06 122
The problem is when i merge these 2 files the output is not what i want sice the content of file1 is not alignned

$ paste -d"\t\n" `cat file0 file1`
chu0 chu1

dia Cantidad dia Cantidad

01 257 01 257
02 262 02 262
03 260 03 260
04 58 04 283
05 253
06 122

$the output should be

dia Cantidad dia Cantidad

01 257 01 257
02 262 02 262
03 260 03 260
04 58 04 283
05 253
06 122
  #2 (permalink)  
Old 01-08-2007
DILEEP410 DILEEP410 is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 148
make clear your requirement.
  #3 (permalink)  
Old 01-08-2007
alexcol alexcol is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 31
Cool Output 2 files horizontally with paste command

i run this commad, so the output is displayed:
paste ./chu0/filechu ./chu1/filechu
chu0 chu1
dia Cantidad dia Cantidad

01 257 01 257
02 262 02 262
03 260 03 260
04 58 04 283
05 253
06 122
The rows 5 and 6 are not aligned, they must be aligned right to file ./file1/filechu, because the content of ./chu1/filechu is:

chu1
dia Cantidad
01 257
02 262
03 260
04 283
05 253
06 122

Hpoe your help. Thanks
  #4 (permalink)  
Old 01-09-2007
DILEEP410 DILEEP410 is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 148
I am using bash oriented shell in suse.I tried out your scenarion and is seems to be working as you intend.i tried the command
`paste filechu1 filechu2` inwhich filechu1 & filechu2 are text files with the same contents as you posted.I got the output as aligned.So pls let me know your environment.
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 11:04 AM.


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