edit columns in unix shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting edit columns in unix shell script
# 1  
Old 06-22-2009
Bug edit columns in unix shell script

i have a file which if you will open as xls will yield something like this:

Column1 Column2 Column3
ABC CDE EFG
GHI IJK KLM
MNO OPQ QRS

what i want to need is to have this kind of results:

Column1
ABC CDE EFG
GHI IJK KLM
MNO OPQ QRS

and delete the other two columns.

Thanks!
# 2  
Old 06-22-2009
what have you tried?
# 3  
Old 06-22-2009
so want those column2 and column3 header to be removed??
# 4  
Old 06-22-2009
actually, i just used "column1", "column2" and "column3" to show that the original file is in columns. yes, after joining the text in one column, delete the other columns
# 5  
Old 06-22-2009
joining in the sense?? they are space seperated right??
just print the column1 in first line and the print rest below that that will looks like your o/p
# 6  
Old 06-22-2009
Quote:
Originally Posted by vidyadhar85
joining in the sense?? they are space seperated right??
just print the column1 in first line and the print rest below that that will looks like your o/p
im sorry, but i did'n get that "just print the column1 in first line and the print rest below that that will looks like your o/p".
# 7  
Old 06-22-2009
I mean this..
Code:
awk 'BEGIN{print "column1"}NR>1{print}' filename

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX shell script required to read two columns from xml

Hello All, I am new to unix scripting. I need to read FROMINSTANCE, FROMFIELD from below XML code and need to write a script for insert into SQ_EPIC values( "DID", "PROJECT_NAME") Select DID, PROJECT_NAME from EPIC<CONNECTOR TOINSTANCETYPE="Source Qualifier" TOINSTANCE="SQ_EPIC" TOFIELD="DID"... (7 Replies)
Discussion started by: sekhar.lsb
7 Replies

2. Homework & Coursework Questions

Edit the file in shell script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am trying to automate hadoop installation procedure using shell script. It involves go to perticular directory... (3 Replies)
Discussion started by: Abdul Navaz
3 Replies

3. UNIX for Dummies Questions & Answers

UNIX script unable to edit

Hello every one, I am a newbie , I am trying to run the script .sh file , but when I run this, I need this backup file to store at some location called " /A/B " ,but this location should only consist the latest backup file. which mean at any time this location only consists the latest backup... (2 Replies)
Discussion started by: karthik25
2 Replies

4. Shell Programming and Scripting

Howto compare the columns of 2 diff tables of 2 different schemas in UNIX shell script

HI All, I am new to Unix shell scripts.. Could you please post the unix shell script for for the below request., There are two different tables(sample1, sample2) in different schemas(s_schema1, s_schema2). Unix shell script to compare the columns of two different tables of two... (2 Replies)
Discussion started by: Rajkumar Gopal
2 Replies

5. Shell Programming and Scripting

shell script to edit a file

i have a file called number which contains data as 1 2 3 4 5 6 7 8 9 0 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 needed a shell script to print the output as 1 7 7 1 4 and (2 Replies)
Discussion started by: jacky29
2 Replies

6. Shell Programming and Scripting

Shell script to edit a file

Hello, I have a big file in wich I would like to rename inside this exactly the string '_ME' and not rename in case we have 'ABC_MELANGE'. Is there a way to do it by using a shell script? Any tip will be apreciated. The file is like described bellow, after using command more filename : ... (3 Replies)
Discussion started by: Titas
3 Replies

7. Shell Programming and Scripting

Can we edit crontab using a shell script

Hi, Can some one tell me if we can configure the jobs in crontab using a shell script. I know it can be done easily by using "crontab -e", but i just want to know whether we can add a job into the crontab using a shell script. If it can be done, plz suggest the procedure to do it. If it... (6 Replies)
Discussion started by: rudrarajumk
6 Replies

8. Shell Programming and Scripting

Need help in a shell script to edit a tablespace creation script.

Hi, CREATE TABLESPACE aps_blob_large01 DATAFILE '/c2r6u13/u03/oradata/qnoldv01/aps_blob_large0101.dbf' SIZE X 270532608 REUSE DEFAULT STORAGE (INITIAL 134217728 NEXT... (2 Replies)
Discussion started by: rparavastu
2 Replies

9. Shell Programming and Scripting

shell script to edit the content of a file

Hi I need some help using shell script to edit a file. My original file has the following format: /txt/email/myemail.txt /txt/email/myemail2.txt /pdf/email/myemail.pdf /pdf/email/myemail2.pdf /doc/email/myemail.doc /doc/email/myemail2.doc I need to read each line. If the path is... (3 Replies)
Discussion started by: tiger99
3 Replies

10. 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
Login or Register to Ask a Question