Edit txt file using vi editor


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Edit txt file using vi editor
# 1  
Old 01-29-2007
Edit txt file using vi editor

Dear All

I have a file called sample.txt which contains as follows

HR Files records Loaded RecordDate Unloaded
-- ---- -------- --------- ------------ ------
00 567 77777 67896 0 0
01 345 345567 45678 0 0

I want to update the file using VI Editor , that is i want to insert or update values for RecordDate and Unloaded column with out touching other fields.Only update RecordDate and Unloaded fields , other data will remain same. I tried with ed command but i am not able to do it.How to do this...;
# 2  
Old 01-29-2007
Code:
s/\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)/\1 \2 \3 \4 2323 4545/

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Vim, vi and nano editor shows help.txt automatically

Hi, Whenever i try to open a file in any editor like vi, vim and nano i get this help.txt showing up in split screen without any key being pressed. This continues to pop up even when i close the help.txt. This behavior happens only when i am connected via putty. Is there a fix to this issue? ... (1 Reply)
Discussion started by: sunil0391
1 Replies

2. Solaris

I can't edit a txt file shared from Window server to Solaris

Hello, I'm working with Solaris and I need to share files between Windows Server 2012 and Solaris through an authentication with an Active Directory user, where Windows Server is the "main server". All was going good, until after see the WS files and I tried to open one and modify it, but I cannot... (1 Reply)
Discussion started by: QeratD0
1 Replies

3. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

4. Shell Programming and Scripting

ksh script to edit a file using vi editor

I was wondering if it is possible to execute a script that will remove a certain search pattern from a file and save it? Manually I would just hit escape to enter command mode then search and delete the pattern "./srv 135.0.0.1.11111 210;=1" then save & exit the file vi command to search and... (3 Replies)
Discussion started by: seekryts15
3 Replies

5. Shell Programming and Scripting

To transpose columns + edit in a txt file

Hi, I have a txt file that looks like log2FoldChange Ontology_term 8.50624450251828 GO:0003700,GO:0003707,GO:0005634,GO:0006355,GO:0043401,GO:0003700,GO:0005634,GO:0006355,GO:0008270,GO:0043565 7.03936870356684 GO:0005515,GO:0008080 6.49606183738682 6.49525073909629 GO:0005515... (4 Replies)
Discussion started by: alisrpp
4 Replies

6. Solaris

edit a file without use editor vi

hi all i have a problem i want to edit a file without use the "vi" . for example i want to edit a passwd file without to do "vi" in file. how i can to do this? Regards (4 Replies)
Discussion started by: FrancescoIt
4 Replies

7. Shell Programming and Scripting

How to edit a txt file ?

Hi, I need to edit a text file which is like this.. -- D3341000600 AGEC901164 XYZ SE0109 1RNVX AH 2009-01-19 2009-01-11 2009-01-21 -- D3341000600 AGEC901164 XYZ SE0109 1RNVX AH 2009-01-19 2009-01-11 2009-01-21 -- D3341006000 AGEC921472 ... (4 Replies)
Discussion started by: RRVARMA
4 Replies

8. UNIX for Dummies Questions & Answers

Binary txt file received when i use uuencode to send txt file as attachment

Hi, I have already read a lot of posts on sending attachments in unix...but none of them were of help for my problem...so here goes.. i wanna attach a text file and send to a mail id..used the following code : uuencode "$File1" "$File1" ;|mail -s "$Mail_sub" abc@abc.com it works... (2 Replies)
Discussion started by: ash22
2 Replies

9. AIX

How to edit txt file by shell script?

What I want to do is just delete some lines from a text file, I know it's easy using copy and redirect function, but what I have to do is edit this file (delete the lines) directly, as new lines may be added to the text file during this period. Can AIX do this ? # cat text 1:line1 2:line2... (3 Replies)
Discussion started by: dupeng
3 Replies

10. UNIX for Dummies Questions & Answers

Edit txt?

Hi! A windows user going UNIX on part time, oh no?!! So my question is how I edit and save documents in UNIX? In DOS you can type 'edit x.txt' to both create a new file and edit a file that already exists. How do I do this in Unix? (2 Replies)
Discussion started by: <Therapy>
2 Replies
Login or Register to Ask a Question