Home » Infrastructure » Unix » cut and paste in UNIX
cut and paste in UNIX [message #112399] Thu, 24 March 2005 16:55 Go to next message
darry
Messages: 3
Registered: March 2005
Location: Philippines
Junior Member
Hi,

I'm a beginner on UNIX scripting and i'm working on a script that needs to cut and paste columns. What I mean is that i need to interchange the columns but i don't know how to paste what i have cut..Hope you can help me.


Thanks in advance.
Darry
Re: cut and paste in UNIX [message #112406 is a reply to message #112399] Thu, 24 March 2005 18:01 Go to previous messageGo to next message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
How are you cutting them?

For scripted text manipulation I would try sed, awk, ex or Perl.
Re: cut and paste in UNIX [message #112411 is a reply to message #112406] Thu, 24 March 2005 20:17 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
tst> cat t.txt
01 data02
11 data12
21 data22
tst> export DT=`date`
tst> cat t.txt | awk '{print $2, $1,"'"$DT"'"}'
data02 01 Thu Mar 24 17:09:42 PST 2005
data12 11 Thu Mar 24 17:09:42 PST 2005
data22 21 Thu Mar 24 17:09:42 PST 2005


see http://www.akadia.com/services/ora_important_2000.html (serach for Eliminating characters from the data file)

Re: cut and paste in UNIX [message #112432 is a reply to message #112411] Fri, 25 March 2005 06:00 Go to previous messageGo to next message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
Why cat though?
Re: cut and paste in UNIX [message #112438 is a reply to message #112432] Fri, 25 March 2005 07:18 Go to previous message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
Also I noticed the tip Avoid Rollback Segement Problems with huge Updates / Deletes (on the page you linked to) does not work. (After you fix the two typos, you get "ORA-01002: fetch out of sequence" because it fetches across commits with a FOR UPDATE cursor.) It's unrelated I know, but it just happened to be the first one I looked at.

Update:
The next tip I looked at was How to avoid performance disaster with PL/SQL tables, where the author appears not to be familiar with IN parameters.

[Updated on: Fri, 25 March 2005 07:43]

Report message to a moderator

Previous Topic: Patch installation error
Next Topic: Oracle Listner Hangs After IP Change
Goto Forum:
  


Current Time: Thu Apr 25 01:19:24 CDT 2024