CVS file operation in Perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting CVS file operation in Perl
# 1  
Old 11-03-2009
CVS file operation in Perl

Hi All,

I have one CVS file, and doing some actions on it. I have removed some columns by

Code:
SWITCH: {
                          $column eq 'COL1' && do {next;};
                          $column eq 'COL2' && do {next;};
                          push(@columns, $column);
                        }

Now I want to shift COL3 to last column. i.e.

Code:
Input:
COL23,COL3,COL21

Output:
COL23,COL21,COL3

Please help!!

---------- Post updated at 02:25 AM ---------- Previous update was at 12:31 AM ----------

no worries dudes.... done with the solution...
Smilie
gentleDean
# 2  
Old 11-04-2009
By shell:

Code:
$ echo "COL23,COL3,COL21" |awk -F[,] '{print $1,$3,$2}' OFS=","
COL23,COL21,COL3

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How To Save A File As A .cvs

Hello. I have a file of text with columns: aaaa bbbb ccc dddd aaaa bbbb ccc dddd aaaa bbbb ccc dddd How can this be converted to a .csv file? Thanks (4 Replies)
Discussion started by: jimmyf
4 Replies

2. Programming

How to create a new file in a CVS repository

I have a coding project that I'm working on, and I'm tracking revisions using CVS. I'm working on a branch (branch1) at version 1.1.2.1. Anyway, I created a new C file in the directory for the project, but I can't commit it. The tutorial I read on CVS said that version numbers will be assigned... (6 Replies)
Discussion started by: Ultrix
6 Replies

3. Programming

updating data in cvs file using c programming

hi every one i want to read and write data from cvs file using c program. but my problem is that at run time my data is increasing in both row wise and column wise. that means it is continuously updating in both direction. is there any way through which i can find the next colum or row for eg... (0 Replies)
Discussion started by: sajidtariq
0 Replies

4. Shell Programming and Scripting

Column operation : cosne and sine operation

I have a txt file with several columns and i want to peform an operation on two columns and output it to a new txt file . file.txt 900.00000 1 1 1 500.00000 500.00000 100000.000 4 4 1.45257346E-07 899.10834 ... (4 Replies)
Discussion started by: shashi792
4 Replies

5. Shell Programming and Scripting

Perl: combine Backtick & system() I/O operation?

Hi - Within perl I want to execute a system command. I want to re-direct all the output from the command to a file (@result = `$cmd`;), but I ALSO want the results to be displayed on the screen (system("$cmd"); The reason is this - if the command completes, I want to process the output. If the... (6 Replies)
Discussion started by: jeffw_00
6 Replies

6. Shell Programming and Scripting

Problem in attaching CVS file to the mail

i wrote this code(( cat $REPORT_EMAIL;uuencode <$OUTFILE $OUTFILE ) | mailx -s "Auto Policy Attach Report Before batch job " $SUPPORT_EMAIL_GRP) in my shell script to attach afile but in the mail i donot get a attachment contais of the mail is Auto Policy Attach Report Before batch job... (0 Replies)
Discussion started by: alokjyotibal
0 Replies

7. UNIX for Dummies Questions & Answers

Copy a windows CVS file to the unix server as a svs file

I so desperately need a script to copy a windows csv file to my unix server and i know these should be at dummies but i have no bits. it is life & no job situation help please. thanks (1 Reply)
Discussion started by: zhegal
1 Replies

8. Shell Programming and Scripting

script grabbing cvs file .....

how do I write a script to checkout a file in cvs and cat the file into a file in my home directory Commands are cd /home/smr/sandbox cvsroot choose option 1 cvs co filename cat filename > /home/smr/newfilename Thank you! (4 Replies)
Discussion started by: llsmr777
4 Replies

9. UNIX for Advanced & Expert Users

Adding a CVS tag to a new file

All, I've been working with perl scripts and shell scripts for quite some time now. I've been making code changes and submitting them into cvs. But I've never created a new file and added it to the directory tree. I know the cvs commands to add it to the directory tree. What I don't know is... (1 Reply)
Discussion started by: rahulrathod
1 Replies

10. Shell Programming and Scripting

CVS, Perl and VI

I am trying to write a Perl script to cover a few CVS commands (setup specifically), however the VI screen that pops up and requests a comment, what is the best way of entering the text automatically (will be a variable name) and then saving that cvs notification from my Perl program? Help is... (2 Replies)
Discussion started by: Shakey21
2 Replies
Login or Register to Ask a Question