02-18-2008
Sorry, I probably didn't make my question clear.
I have a file (proc.txt) which has a list of lines I want to remove from a file (draft). I can not hard code the lines in my shell script since each line in the proc.txt are different.
I believe I need a loop to check each line in proc.txt and remove the line from (draft) and copy them to a file.
So the input/output I am hoping to get is
Draft(before remove)
Author:
Date:
1 /vobs/aw/database/a.proc/
2 /vobs/aw/database2/b.proc/
3 /vobs/aw/database4/a.proc/
4 /vobs/aw/database4/b.proc/
5 /vobs/aw/database2/d.proc/
...etc
proc.txt
/vobs/aw/database2/b.proc/
/vobs/aw/database4/b.proc/
...etc
I hope to write a script to achieve the following:
draft(after remove)
Author:
Date:
1 /vobs/aw/database/a.proc/
3 /vobs/aw/database4/a.proc/
5 /vobs/aw/database2/d.proc/
...etc
proc.txt(no change)
/vobs/aw/database2/b.proc/
/vobs/aw/database4/b.proc/
...etc
output.txt(new file)
2 /vobs/aw/database2/b.proc/
4 /vobs/aw/database4/b.proc/
I hope I have made my question more clear.
Is it possible to use shell script to achieve this?
Thanks in advance for your help
9 More Discussions You Might Find Interesting
1. UNIX Desktop Questions & Answers
One of the things that I have learned to take for granted in the Win32 world is the cut, copy and paste hotkeys of ^X, ^C and ^V.
I use these keys all the time under Win32 to copy and paste information from one GUI into another GUI.
My question is, does X have a similiar standard?
... (4 Replies)
Discussion started by: auswipe
4 Replies
2. UNIX for Dummies Questions & Answers
Hi all!
How do I cut, copy and paste under unix??? (2 Replies)
Discussion started by: aitor314
2 Replies
3. Shell Programming and Scripting
Hi
I want to grep for a line and copy and paste that line.
for Example
---- file abc.txt ----
host=atlx1 sid=atld1 mail=abc@abc.com
host=atlx2 sid=atld2 mail=xyz@abc.com
host=atlx3 sid=atld3 mail=def@abc.com
host=atlx4 sid=atld4 mail=mno@abc.com
--- end of file abc.txt ----
Now I... (16 Replies)
Discussion started by: upsrk
16 Replies
4. UNIX for Dummies Questions & Answers
I'm having a problem copy/pasting from a txt file in windows to vi. What happens is I copy a chunk of text, go to the putty terminal, go into insert mode, and right click, and it will stop pasting at a random point and freeze up. Nothing I do gets out of it.
This only happens on my account... (1 Reply)
Discussion started by: solidarity
1 Replies
5. UNIX for Dummies Questions & Answers
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Discussion started by: cokedude
3 Replies
6. Shell Programming and Scripting
Hi,
I want to know how I can copy line 6th to 10th and paste it after 17th line in same file.
Thanks,
Biplab (19 Replies)
Discussion started by: Biplab
19 Replies
7. Shell Programming and Scripting
I have one mainframe copy book where I want to copy n times depend on occurs which mention below.
Example:
Below highlighted row mention “occurs 2 times” so I need to copy 2 times till next label 10.
C14992 10 FILLER PIC X(2835).
01 ... (7 Replies)
Discussion started by: srivalli
7 Replies
8. UNIX for Dummies Questions & Answers
Hello guys,
I am trying to copy a line in vi editor and paste it with below commands but paste command is not working and instead of paste action prints the p character!!
I should also mention that the server is Solaris...
1) crontab -e
2) j to move down
3) yy to copy the line
4) o to... (4 Replies)
Discussion started by: Newman
4 Replies
9. Shell Programming and Scripting
Hello,
I know there are many questions and replies regarding grep command.
What I would like to do is a bit different.
File A:
hello world welcome to my page
this is my test site
how are you
I am fine, thank you
where have you been
I was in hospital
really hope you are fine now
Thanks,... (10 Replies)
Discussion started by: baris35
10 Replies