[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Replacing first column value using VI

Posted on 2000-01-20
6
Medium Priority
?
279 Views
Last Modified: 2010-04-21
I have a Tab delimited file with first col value =I which i want to change to U.
Can I do this in VI? If so how?
Thanks
suresh
0
Comment
Question by:sollala
  • 3
  • 3
6 Comments
 

Accepted Solution

by:
tspfwj earned 40 total points
ID: 2372271
Is this what you are looking for ?
:1,$s/I/U/
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2373645
won' do what sollala wants :(
try:
:%s/^|/U/
0
 

Expert Comment

by:tspfwj
ID: 2374427
s/^I/U/ will only work if the I is the first character on the line, correct ??
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 2375408
yes, could be improved like this:
 :%s/[ \t]*|/U/
(where \t is tab)
while  s/|/U/ changes also lines where | is not in the first column, like:
    sometext containug |, but not in first column
0
 

Expert Comment

by:tspfwj
ID: 2375416
I see what you mean, I had based the construct on her original quesion idicating that the "I" was in the first tab delineated column, you're right about changing the I anywhere on the line.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2376809
oops, just saw that I should have writte I instead of |
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question