This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Customized Rearrangement of the columns in excel using perl script

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

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?)

2 answers

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.

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

Log in to answer this question.