Question: Customized Rearrangement of the columns in excel using perl script
0
gravatar for sinumolg
2.5 years ago by
sinumolg10
sinumolg10 wrote:

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

ADD COMMENTlink modified 2.5 years ago by shenwei3564.8k • written 2.5 years ago by sinumolg10
4

enter image description here

ADD REPLYlink written 2.5 years ago by Pierre Lindenbaum123k
2

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 REPLYlink written 2.5 years ago by LLTommy1.2k
2
gravatar for Jean-Karim Heriche
2.5 years ago by
EMBL Heidelberg, Germany
Jean-Karim Heriche21k wrote:

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 COMMENTlink written 2.5 years ago by Jean-Karim Heriche21k
2
gravatar for shenwei356
2.5 years ago by
shenwei3564.8k
China
shenwei3564.8k wrote:

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 COMMENTlink written 2.5 years ago by shenwei3564.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1837 users visited in the last hour