473,387 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Removing columns of a file using vi Editor

Hi Gurus,

The data in the file looks like in this format
1 2233|A.K Shukla |G.M |Sales |12/12/52|6000
2 9876|Jai Sharma |Director |Production |12/03/50|67000
3 5678|Sumit Chakarborty |D.G.M |Marketing |19/04/43|6000
4 2365|Barun Sengupta |Director |Personnel |11/05/47|7800
5 5423|N.K. Gupta |Chairman |Admin |30/08/56|5400
6 1006|Chanchal Singhvi |Director |Sales |03/09/38|67000
7 6213|Karuna Ganguly |G.M |Accounts |05/06/62|6300
8 1265|S.N. Sengupta |Manager |Sales |12/09/63|5600
9 4290|Jayant Choudhury |Executive |Production |07/09/50|6000
10 2476|Anil Aggarwal |Manager |Sales |01/05/59|5000
11 6521|Lalit Choudhuwdury |Director |Marketing |26/09/45|8200
12 3212|Shyam Saksena |D.G.M |Accounts |12/12/55|6000
13 3564|Sudhir Agarwal |Executive |Personnel |06/07/47|7500
14 2345|J.B Saxena |G.M |Marketing |12/03/45|8000
15 0110|V.K Agrawal |G.M |Marketing |31/12/40|8900

I want to delete the 1st column using vi Editor.

How can i do that?

Kindly suggest me.

Thanks in Advance.
Dilip
Feb 8 '08 #1
4 20770
ashitpro
542 Expert 512MB
Hi Gurus,

The data in the file looks like in this format
1 2233|A.K Shukla |G.M |Sales |12/12/52|6000
2 9876|Jai Sharma |Director |Production |12/03/50|67000
3 5678|Sumit Chakarborty |D.G.M |Marketing |19/04/43|6000
4 2365|Barun Sengupta |Director |Personnel |11/05/47|7800
5 5423|N.K. Gupta |Chairman |Admin |30/08/56|5400
6 1006|Chanchal Singhvi |Director |Sales |03/09/38|67000
7 6213|Karuna Ganguly |G.M |Accounts |05/06/62|6300
8 1265|S.N. Sengupta |Manager |Sales |12/09/63|5600
9 4290|Jayant Choudhury |Executive |Production |07/09/50|6000
10 2476|Anil Aggarwal |Manager |Sales |01/05/59|5000
11 6521|Lalit Choudhuwdury |Director |Marketing |26/09/45|8200
12 3212|Shyam Saksena |D.G.M |Accounts |12/12/55|6000
13 3564|Sudhir Agarwal |Executive |Personnel |06/07/47|7500
14 2345|J.B Saxena |G.M |Marketing |12/03/45|8000
15 0110|V.K Agrawal |G.M |Marketing |31/12/40|8900

I want to delete the 1st column using vi Editor.

How can i do that?

Kindly suggest me.

Thanks in Advance.
Dilip


So you want to remove line numbers?
I don't know whether that line numbers are the part of your text or it is assigned by vi editor.
any way..we have solutions for both

case 1: If line numbers(in your case) are part of your text.
press the ESC(i.e goto escape mode)
press cntrl + v (i.e ctrl key and v key together)
navigate through arrow keys.
one you finishes your selection. press 'dd'

case 2:If line numbers are given by vi editor
press ESC
press : (i.e colon)
type "set nonu"
Feb 8 '08 #2
So you want to remove line numbers?
I don't know whether that line numbers are the part of your text or it is assigned by vi editor.
any way..we have solutions for both

case 1: If line numbers(in your case) are part of your text.
press the ESC(i.e goto escape mode)
press cntrl + v (i.e ctrl key and v key together)
navigate through arrow keys.
one you finishes your selection. press 'dd'

case 2:If line numbers are given by vi editor
press ESC
press : (i.e colon)
type "set nonu"
I am sorry but the command given by u is not working.
My case is 1st one. Can u suggest any other way.

Thanks
Dilip
Feb 8 '08 #3
ashitpro
542 Expert 512MB
I am sorry but the command given by u is not working.
My case is 1st one. Can u suggest any other way.

Thanks
Dilip
well,
try opening your file with 'vim' command instead 'vi',and try above things again.
Better you tell me OS you are using.
Feb 8 '08 #4
This should remove the line numbers.

Expand|Select|Wrap|Line Numbers
  1. :%s/^[0-9]* //
Feb 8 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: hari patel via .NET 247 | last post by:
hieee there, I am in big trouble. I want to export data from Dataset or Datagrid to .txt file using XML in VB.NET and I want to do it Manually but I don't have any ideas because I am new To XML....
3
by: Ben | last post by:
Hi all - I am having a bit of trouble and thought maybe someone in this group could shed some light. Here's the skinny... I am creating an automated process to import a bunch of text files...
2
by: Amintas Lopes Neto | last post by:
Hi everybody, I am unsuccessfully trying to open an RFT file using ASP .NET 2003. The data stored in the database is like this: {\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans...
4
by: Tom C. | last post by:
Does anyone know how to add the File System Editor to a Visual Studio 2003 installation? Thanks!
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
5
by: Narendar123P | last post by:
Hi all, I am trying to plot a graph in excel file using C#.Net. I am using the name space excel . If my graph has one series(2 columns), i am able to draw the graph. if my graph has two series(4...
1
by: kushaljn | last post by:
Hi All, Not sure if some one has already addressed this Question before. I am writing a header of a CSV file using the following code. if (fileExists == false) { // Write the header...
0
by: acidedgeuk | last post by:
Hi, I am adding a large number of files to the target machine using an MSI installer created in VS 2008. I am having problems with the launch conditions. What I want is a way to prevent files...
4
by: kshw | last post by:
Hi, I'm trying to remove non-stop words from a text file using regular expresions but it is not working. I used something like ('^?or') in order to avoid removing (or) from the mibble of words...
1
by: Arulmanoj | last post by:
Hi, I have to write the content from one csv file to another csv file using VB Script. The scource content file contains 5 columns and the destination file contains six column as below. Source...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.