Reading lines within vi editor


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Reading lines within vi editor
# 1  
Old 08-29-2006
Reading lines within vi editor

Hi All,
I need to read line by line from a file(created using vi editor) till end of the file and pass it to my own executables so that it will read first line and execute and then other and so on...Thanks
The steps are like this;
1) read first line in file
2) execute the job with first line as argument
3) read another line
4) execute the same job with second line as arguments
5) till end of file
# 2  
Old 08-29-2006
So basically you just want to read a file line-by-line? google (a member) explains how to do that here.
# 3  
Old 08-30-2006
Thanks

Let me try this I hope it should work for me...Many Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Vi editor deleting lines with specific pattern

Hi, I need to delete all lines in the file using vi editor which start with word aternqaco. Please assist. aternqaco.__oracle_base='/amdbqa01/app/oracle'#ORACLE_BASE set from environment aternqa.__oracle_base='/amdbqa01/app/oracle'#ORACLE_BASE set from environment... (3 Replies)
Discussion started by: Vishal_dba
3 Replies

2. Shell Programming and Scripting

Insert charactera in 1st position of specific lines using vi editor or sed command

Dear all, i am having text file like below surya rama ranga laxman rajesh reddy i want add string (OK) before a text from line 3 to 5 the result will be surya rama OK ranga OK laxman OK rajesh reddy (1 Reply)
Discussion started by: suryanarayana
1 Replies

3. UNIX for Dummies Questions & Answers

Comment lines in file without vi editor

Legends, Can you please help me in following. I need to comment lines from “/tmp/a.txt” from the line A to line B through the command prompt only. Please use variables not direct values like 2 or 5 It can be done with VI editor but it's not matches with my requirement (: 2,5 s/^/#/g). ... (1 Reply)
Discussion started by: sdosanjh
1 Replies

4. UNIX for Dummies Questions & Answers

Is there a limit in number of lines to be Copy pasted in VI editor ?

In my old shop, we only had AIX machines there (all of version 6.1 ). FTP ports were not open for these AIX machines because of some security thing. So, we can't ftp scripts in ASCII mode. When we wanted to copy huge scripts (shell scripts, sql scripts , ..etc) from our Windows based laptop... (6 Replies)
Discussion started by: kraljic
6 Replies

5. UNIX for Dummies Questions & Answers

to check the latest lines of log in vi editor itself..

Hi Folks, If I open the logs in vi editor but as the logs get update after few seconds and I want to see the latest lines then whats the command to see the latest lines in vi editor itself , lets say I have open a log named abc.log in vi..!! vi abc.log (2 Replies)
Discussion started by: SankalpS
2 Replies

6. Shell Programming and Scripting

Reading two lines in a while loop and combining the lines

Dear all, I have a file like this: imput scaffold_0 1 scaffold_0 10000 scaffold_0 20000 scaffold_0 25000 scaffold_1 1 scaffold_1 10000 scaffold_1 20000 scaffold_1 23283 and I want the output like this: scaffold_0 1 scaffold_0 10000 scaffold_0 10000 scaffold_0 20000... (6 Replies)
Discussion started by: valente
6 Replies

7. UNIX for Dummies Questions & Answers

vi editor prefixes lines with # upon paste

I've been away from Unix and the vi editor for a while, and now I'm using vi (actually vim) in a Cygwin bash shell. When I copy-and-paste code examples (I'm playing with perl now) any time I paste code with lines beginning with the # character, vi inserts a # character at the beginning of every... (2 Replies)
Discussion started by: greenmangroup
2 Replies

8. Shell Programming and Scripting

vi editor - interchange two lines

Hi, I have a quick question regarding vi editor.Is it possible to interchange two lines in vi editor without using the possibilites of cut-paste,copy paste etc? Your help is appreciated! Regards Dileep (4 Replies)
Discussion started by: DILEEP410
4 Replies

9. Shell Programming and Scripting

reading lines

Hi all, I have a file whose content I need to read and get the 3rd line .. ex: one two three What I need is to read a content of third line of this file and print first three characters ... I could print first three characters with "head -c 3" if I could get the content of the third line... (4 Replies)
Discussion started by: c0mrade
4 Replies

10. UNIX for Dummies Questions & Answers

How to put the comments to 50 lines, using vi editor?

Hi All, Please let me know how I can put a comment (e.g // or #) to more than 50 lines using vi editor in a .cpp/.sh file. Thanks in advance. (3 Replies)
Discussion started by: artikulkarni
3 Replies
Login or Register to Ask a Question