Spreadsheet formatting [on hold] The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsMerge fields in a fileHow to paste an HTML table into Libre Office Calc without losing structureMove files/table following selection criteriaReplace values in a tableDelete columns that sum to zeroExtracting quoted and labelled data from a given columnFinding the different possible combinationsMatch File1 with File 2Compare Columns of genes in file and output the gene and number of column it is present in linuxAdding more information to a string
What is this lever in Argentinian toilets?
He got a vote 80% that of Emmanuel Macron’s
Cooking pasta in a water boiler
Change bounding box of math glyphs in LuaTeX
What's the point in a preamp?
What information about me do stores get via my credit card?
How many people can fit inside Mordenkainen's Magnificent Mansion?
Can the DM override racial traits?
Did the new image of black hole confirm the general theory of relativity?
Arduino Pro Micro - switch off LEDs
Make it rain characters
Create an outline of font
Simulation of a banking system with an Account class in C++
How did passengers keep warm on sail ships?
How is simplicity better than precision and clarity in prose?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
Segmentation fault output is suppressed when piping stdin into a function. Why?
What was the last x86 CPU that did not have the x87 floating-point unit built in?
Relations between two reciprocal partial derivatives?
Python - Fishing Simulator
When did F become S in typeography, and why?
What can I do if neighbor is blocking my solar panels intentionally?
What are these Gizmos at Izaña Atmospheric Research Center in Spain?
Is above average number of years spent on PhD considered a red flag in future academia or industry positions?
Spreadsheet formatting [on hold]
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election ResultsMerge fields in a fileHow to paste an HTML table into Libre Office Calc without losing structureMove files/table following selection criteriaReplace values in a tableDelete columns that sum to zeroExtracting quoted and labelled data from a given columnFinding the different possible combinationsMatch File1 with File 2Compare Columns of genes in file and output the gene and number of column it is present in linuxAdding more information to a string
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have gene name in column 1 and respective diseases in column 2 as shown in table 1,Now i want the format to be gene name in column1 and all respective diseases row wise as shown in table 2, Can anyone suggest me solution for reformatting this table
bioinformatics table
New contributor
put on hold as off-topic by Ruban Savvy, HBruijn, Stephen Kitt, Rui F Ribeiro, Romeo Ninov Apr 10 at 8:36
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
add a comment |
I have gene name in column 1 and respective diseases in column 2 as shown in table 1,Now i want the format to be gene name in column1 and all respective diseases row wise as shown in table 2, Can anyone suggest me solution for reformatting this table
bioinformatics table
New contributor
put on hold as off-topic by Ruban Savvy, HBruijn, Stephen Kitt, Rui F Ribeiro, Romeo Ninov Apr 10 at 8:36
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
1
This is not related to Unix & Linux, but with the use of Office suites. Please read unix.stackexchange.com/help/on-topic
– Panki
Apr 10 at 7:07
4
I'm voting to close this question as off-topic because this is wrt office suite & not Unix and Linux
– Ruban Savvy
Apr 10 at 7:27
It maybe technically 'off-topic' but the solution is simple and introduces OP to the command line..... isn't that a good thing? We all had to start somewhere.
– bu5hman
Apr 10 at 8:01
Voting to leave open, since it's about what appears to be LibreOffice on Ubuntu.
– muru
Apr 10 at 8:05
It’s about LibreOffice, yes, but there’s nothing specific to Unix/Linux here. I don’t know whether there’s a better SE for this though...
– Stephen Kitt
2 days ago
add a comment |
I have gene name in column 1 and respective diseases in column 2 as shown in table 1,Now i want the format to be gene name in column1 and all respective diseases row wise as shown in table 2, Can anyone suggest me solution for reformatting this table
bioinformatics table
New contributor
I have gene name in column 1 and respective diseases in column 2 as shown in table 1,Now i want the format to be gene name in column1 and all respective diseases row wise as shown in table 2, Can anyone suggest me solution for reformatting this table
bioinformatics table
bioinformatics table
New contributor
New contributor
edited Apr 10 at 8:17
roaima
46.2k758124
46.2k758124
New contributor
asked Apr 10 at 6:38
Yashwanth KumarYashwanth Kumar
1
1
New contributor
New contributor
put on hold as off-topic by Ruban Savvy, HBruijn, Stephen Kitt, Rui F Ribeiro, Romeo Ninov Apr 10 at 8:36
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
put on hold as off-topic by Ruban Savvy, HBruijn, Stephen Kitt, Rui F Ribeiro, Romeo Ninov Apr 10 at 8:36
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
1
This is not related to Unix & Linux, but with the use of Office suites. Please read unix.stackexchange.com/help/on-topic
– Panki
Apr 10 at 7:07
4
I'm voting to close this question as off-topic because this is wrt office suite & not Unix and Linux
– Ruban Savvy
Apr 10 at 7:27
It maybe technically 'off-topic' but the solution is simple and introduces OP to the command line..... isn't that a good thing? We all had to start somewhere.
– bu5hman
Apr 10 at 8:01
Voting to leave open, since it's about what appears to be LibreOffice on Ubuntu.
– muru
Apr 10 at 8:05
It’s about LibreOffice, yes, but there’s nothing specific to Unix/Linux here. I don’t know whether there’s a better SE for this though...
– Stephen Kitt
2 days ago
add a comment |
1
This is not related to Unix & Linux, but with the use of Office suites. Please read unix.stackexchange.com/help/on-topic
– Panki
Apr 10 at 7:07
4
I'm voting to close this question as off-topic because this is wrt office suite & not Unix and Linux
– Ruban Savvy
Apr 10 at 7:27
It maybe technically 'off-topic' but the solution is simple and introduces OP to the command line..... isn't that a good thing? We all had to start somewhere.
– bu5hman
Apr 10 at 8:01
Voting to leave open, since it's about what appears to be LibreOffice on Ubuntu.
– muru
Apr 10 at 8:05
It’s about LibreOffice, yes, but there’s nothing specific to Unix/Linux here. I don’t know whether there’s a better SE for this though...
– Stephen Kitt
2 days ago
1
1
This is not related to Unix & Linux, but with the use of Office suites. Please read unix.stackexchange.com/help/on-topic
– Panki
Apr 10 at 7:07
This is not related to Unix & Linux, but with the use of Office suites. Please read unix.stackexchange.com/help/on-topic
– Panki
Apr 10 at 7:07
4
4
I'm voting to close this question as off-topic because this is wrt office suite & not Unix and Linux
– Ruban Savvy
Apr 10 at 7:27
I'm voting to close this question as off-topic because this is wrt office suite & not Unix and Linux
– Ruban Savvy
Apr 10 at 7:27
It maybe technically 'off-topic' but the solution is simple and introduces OP to the command line..... isn't that a good thing? We all had to start somewhere.
– bu5hman
Apr 10 at 8:01
It maybe technically 'off-topic' but the solution is simple and introduces OP to the command line..... isn't that a good thing? We all had to start somewhere.
– bu5hman
Apr 10 at 8:01
Voting to leave open, since it's about what appears to be LibreOffice on Ubuntu.
– muru
Apr 10 at 8:05
Voting to leave open, since it's about what appears to be LibreOffice on Ubuntu.
– muru
Apr 10 at 8:05
It’s about LibreOffice, yes, but there’s nothing specific to Unix/Linux here. I don’t know whether there’s a better SE for this though...
– Stephen Kitt
2 days ago
It’s about LibreOffice, yes, but there’s nothing specific to Unix/Linux here. I don’t know whether there’s a better SE for this though...
– Stephen Kitt
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
Save the table in csv format (e.g. myTable.csv), manipulate the columns in awk
or similar
awk -F, ' print $2","$1"' myTable.csv > myNewTable.csv
Open the new file (myNewTable.csv).
EDIT Misread the question as pointed out by @roaima
you could try this instead
d=disease.csv
#get rid of the spaces for convenience
sed -i 's/ /_/g' $d
# collect all of the unique identifiers into a list
for i in $(grep -Po "^.[^,]*" < $d | sort | uniq)
#load all diseases associated with the uid into an array
do b=($(grep -Po "(?<=$i,).*" $d))
#output the uid and array comma separated
(IFS=,; echo "$i,$b[*]")
done > sorted.$d
That transposes the list. It doesn't do what the OP's asking.
– roaima
Apr 10 at 8:25
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Save the table in csv format (e.g. myTable.csv), manipulate the columns in awk
or similar
awk -F, ' print $2","$1"' myTable.csv > myNewTable.csv
Open the new file (myNewTable.csv).
EDIT Misread the question as pointed out by @roaima
you could try this instead
d=disease.csv
#get rid of the spaces for convenience
sed -i 's/ /_/g' $d
# collect all of the unique identifiers into a list
for i in $(grep -Po "^.[^,]*" < $d | sort | uniq)
#load all diseases associated with the uid into an array
do b=($(grep -Po "(?<=$i,).*" $d))
#output the uid and array comma separated
(IFS=,; echo "$i,$b[*]")
done > sorted.$d
That transposes the list. It doesn't do what the OP's asking.
– roaima
Apr 10 at 8:25
add a comment |
Save the table in csv format (e.g. myTable.csv), manipulate the columns in awk
or similar
awk -F, ' print $2","$1"' myTable.csv > myNewTable.csv
Open the new file (myNewTable.csv).
EDIT Misread the question as pointed out by @roaima
you could try this instead
d=disease.csv
#get rid of the spaces for convenience
sed -i 's/ /_/g' $d
# collect all of the unique identifiers into a list
for i in $(grep -Po "^.[^,]*" < $d | sort | uniq)
#load all diseases associated with the uid into an array
do b=($(grep -Po "(?<=$i,).*" $d))
#output the uid and array comma separated
(IFS=,; echo "$i,$b[*]")
done > sorted.$d
That transposes the list. It doesn't do what the OP's asking.
– roaima
Apr 10 at 8:25
add a comment |
Save the table in csv format (e.g. myTable.csv), manipulate the columns in awk
or similar
awk -F, ' print $2","$1"' myTable.csv > myNewTable.csv
Open the new file (myNewTable.csv).
EDIT Misread the question as pointed out by @roaima
you could try this instead
d=disease.csv
#get rid of the spaces for convenience
sed -i 's/ /_/g' $d
# collect all of the unique identifiers into a list
for i in $(grep -Po "^.[^,]*" < $d | sort | uniq)
#load all diseases associated with the uid into an array
do b=($(grep -Po "(?<=$i,).*" $d))
#output the uid and array comma separated
(IFS=,; echo "$i,$b[*]")
done > sorted.$d
Save the table in csv format (e.g. myTable.csv), manipulate the columns in awk
or similar
awk -F, ' print $2","$1"' myTable.csv > myNewTable.csv
Open the new file (myNewTable.csv).
EDIT Misread the question as pointed out by @roaima
you could try this instead
d=disease.csv
#get rid of the spaces for convenience
sed -i 's/ /_/g' $d
# collect all of the unique identifiers into a list
for i in $(grep -Po "^.[^,]*" < $d | sort | uniq)
#load all diseases associated with the uid into an array
do b=($(grep -Po "(?<=$i,).*" $d))
#output the uid and array comma separated
(IFS=,; echo "$i,$b[*]")
done > sorted.$d
edited 13 hours ago
answered Apr 10 at 7:59
bu5hmanbu5hman
1,356415
1,356415
That transposes the list. It doesn't do what the OP's asking.
– roaima
Apr 10 at 8:25
add a comment |
That transposes the list. It doesn't do what the OP's asking.
– roaima
Apr 10 at 8:25
That transposes the list. It doesn't do what the OP's asking.
– roaima
Apr 10 at 8:25
That transposes the list. It doesn't do what the OP's asking.
– roaima
Apr 10 at 8:25
add a comment |
1
This is not related to Unix & Linux, but with the use of Office suites. Please read unix.stackexchange.com/help/on-topic
– Panki
Apr 10 at 7:07
4
I'm voting to close this question as off-topic because this is wrt office suite & not Unix and Linux
– Ruban Savvy
Apr 10 at 7:27
It maybe technically 'off-topic' but the solution is simple and introduces OP to the command line..... isn't that a good thing? We all had to start somewhere.
– bu5hman
Apr 10 at 8:01
Voting to leave open, since it's about what appears to be LibreOffice on Ubuntu.
– muru
Apr 10 at 8:05
It’s about LibreOffice, yes, but there’s nothing specific to Unix/Linux here. I don’t know whether there’s a better SE for this though...
– Stephen Kitt
2 days ago