Customized Rearrangement of the columns in excel using perl script
2
0
Entering edit mode
7.0 years ago
sinumolg ▴ 10

Hi

I have an excel containing 1000 s of columns. I have to rearrange the columns into a different order. The new order is in a text file , according to that order i want to generate a new output file

for eg:

A B C D .........

i want to rearrange this like

C A D B

Please help me . Thanks in advance

R rna-seq next-gen sequencing blast • 2.1k views
ADD COMMENT
4
Entering edit mode

enter image description here

ADD REPLY
2
Entering edit mode

I absolutely agree with Pierre. If you have files with 1000s of columns it is really time to think about your approach, but it does not sound like Excel is the way to more forward! While you might find a way to solve this problem with a work around now, you will run into problems time and time and time again if you keep working with this amount of data and try to do it with Excel. (What is the next step after you rearranged your columns? You still have 1000s of columns and at a certain point you will want to analyse that data, will you not?)

ADD REPLY
2
Entering edit mode
7.0 years ago

This is not really a bioinformatics question. Try Stack Overflow or perl monks. For your information, there are several perl modules for dealing with Excel files. An alternative is to convert the file to plain text with a standard delimiter and work from there.

ADD COMMENT
2
Entering edit mode
7.0 years ago

on windows? save the excel data as csv file and reorder the column using csvtk cut.

csvtk cut -f C,A,D,B data.csv > new.csv
ADD COMMENT

Login before adding your answer.

Traffic: 2549 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6