- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Scripting question related to joining two files wi...
Operating System - HP-UX
1753778
Members
8095
Online
108799
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2009 09:02 AM
тАО08-06-2009 09:02 AM
Hello,
I have two files named "abc" and "xyz". Their contents are here:
File "abc":
object1
object2
object3
File "xyz":
table1
table2
table3
My requirement is to create an command output like this.
delete from 'object1' on 'table1';
delete from 'object2' on 'table2';
delete from 'object3' on 'table3';
Right now, I played with "vi" and able to create the new file.... However, is it a better sed or awk one liner for this? or even perl?
I will assign the points.
Regards
Vijay Chinnasamy
I have two files named "abc" and "xyz". Their contents are here:
File "abc":
object1
object2
object3
File "xyz":
table1
table2
table3
My requirement is to create an command output like this.
delete from 'object1' on 'table1';
delete from 'object2' on 'table2';
delete from 'object3' on 'table3';
Right now, I played with "vi" and able to create the new file.... However, is it a better sed or awk one liner for this? or even perl?
I will assign the points.
Regards
Vijay Chinnasamy
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2009 09:19 AM
тАО08-06-2009 09:19 AM
Solution
The easiest way is:
paste abc xyz
Then format the results into awk or other filters such as this:
$ paste abc xyz | while read OBJ TBL
> do
> echo "delete from '$OBJ' on '$TBL'"
> done
delete from 'object1' on 'table1'
delete from 'object2' on 'table2'
delete from 'object3' on 'table3'
Bill Hassell, sysadmin
paste abc xyz
Then format the results into awk or other filters such as this:
$ paste abc xyz | while read OBJ TBL
> do
> echo "delete from '$OBJ' on '$TBL'"
> done
delete from 'object1' on 'table1'
delete from 'object2' on 'table2'
delete from 'object3' on 'table3'
Bill Hassell, sysadmin
- Tags:
- paste
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2009 09:33 AM
тАО08-06-2009 09:33 AM
Re: Scripting question related to joining two files with a string added....
Works like a champ. Thank you.
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP