sorting

Auto Sort/Auto Summarize Excel

流过昼夜 提交于 2020-01-16 07:25:09
问题 I tried the following code and I can't seem to get things to work... I am needing help to 1) Auto Sort and then 2) Auto Summarize "like-with-like" based on the following column criteria. . . A few things about this list. . . -I need the item list to sort by alphabetical order -Then I need "like" items and quantities to be summarized. -If there is something I type in the NOTE column I need those quantities to be listed separate (Ex: the item LUS26 in the AFTER picture below) -Also, I need this

How to deal with case sensitive sorting for output files? [duplicate]

♀尐吖头ヾ 提交于 2020-01-16 07:03:20
问题 This question already has answers here : case-insensitive list sorting, without lowercasing the result? (7 answers) Closed 4 years ago . I have written a program that randomly generates a series of 5 letters (ASCII, both upper and lower case) in column 1 of a csv and 4 numbers (0-9) in column 2 of a csv and saves them as a file. I can sort column 2 in order of ascending values but struggle with the column 1 as it sorts all the upper case values first and then lower case. this is also output

Sort 2 dimensional List based on first indexvalue

北战南征 提交于 2020-01-16 04:53:08
问题 I have added following values in to my 2D List (List of Lists). It contains weight of fruits followed by their names. Can you please tell me how can I sort this 2D array base on the first index value of weight? List<List<String>> matrix = new List<List<String>>(); matrix.Add(new List<String>()); //Adds new sub List matrix[0].Add("3.256"); matrix[0].Add("Apple"); matrix.Add(new List<String>()); matrix[1].Add("1.236"); matrix[1].Add("Orange"); matrix.Add(new List<String>()); matrix[2].Add("1

Plotting a 3d data read from a file using mayavi

蓝咒 提交于 2020-01-16 04:28:27
问题 I have a data file in the following format: x y z f(x) f(y) f(z) I want to plot it using contour3d of mayavi: def fill_array(output_array,source_array,nx,ny,nz,position): for i in range(nx): for j in range(ny): for k in range(nz): output_array[i][j][k] = source_array[i][j][k][position] nx = 8 ny = 8 nz = 8 ndim = 6 x = np.zeros((nx,ny,nz)) y = np.zeros((nx,ny,nz)) z = np.zeros((nx,ny,nz)) fx = np.zeros((nx,ny,nz)) fy = np.zeros((nx,ny,nz)) fz = np.zeros((nx,ny,nz)) data_file = np.loadtxt(

join all lines that have the same first column to the same line

拟墨画扇 提交于 2020-01-16 03:49:07
问题 IE: File: 1234:abcd 1234:930 1234:999999 194:keee 194:284 194:222222 Result: 1234:abcd:930:999999 194:kee:284:222222 I have exhausted my brain to the best of my knowledge and can't come up with a way. Sorry to bother you guys! 回答1: $ awk -F: '$1==last {printf ":%s",$2; next} NR>1 {print "";} {last=$1; printf "%s",$0;} END{print "";}' file 1234:abcd:930:999999 194:keee:284:222222 How it works -F: This tells awk to use a : as the field separator. $1==last {printf ":%s",$2; next} If the first

join all lines that have the same first column to the same line

坚强是说给别人听的谎言 提交于 2020-01-16 03:49:05
问题 IE: File: 1234:abcd 1234:930 1234:999999 194:keee 194:284 194:222222 Result: 1234:abcd:930:999999 194:kee:284:222222 I have exhausted my brain to the best of my knowledge and can't come up with a way. Sorry to bother you guys! 回答1: $ awk -F: '$1==last {printf ":%s",$2; next} NR>1 {print "";} {last=$1; printf "%s",$0;} END{print "";}' file 1234:abcd:930:999999 194:keee:284:222222 How it works -F: This tells awk to use a : as the field separator. $1==last {printf ":%s",$2; next} If the first

How to sort List of User-defined type in Java?

Deadly 提交于 2020-01-16 03:31:08
问题 I'm currently learning how to work with Lists in Java. I've come across sorting Strings in a List by using Collections.sort() method and that works fine. However when I create a user-defined datatype, it doesn't sort and gives an error - "no suitable method found for sort(List) method Collections.sort(List,Comparator) is not applicable (cannot instantiate from arguments because actual and formal argument lists differ in length) method Collections.sort(List) is not applicable (inferred type

Sorting List<> by numeric value

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 00:54:10
问题 I've got a public List<FriendProfile> friends = new ArrayList<FriendProfile>(); . I initialize the friends list by reading the information from the server. The FriendProfile object contains a int called private int userPosition; Once the friends list has been initialized, I would like to sort the friends list by having the FriendProfile object with the highest userPosition at index 0 of the list and then sort by accordingly, index 1 with the second highest userPosition ... I guess I could

what is the importance of <Integer,Integer> in Map.Entry.<Integer, Integer>comparingByValue()

会有一股神秘感。 提交于 2020-01-16 00:41:24
问题 I am trying to sort elements by their frequency import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; import java.util.stream.Collectors; public class Solution { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int itr = Integer.parseInt(br.readLine()); for (int i = 0; i < itr; i++) { int n = Integer.parseInt(br.readLine()); String[] val = br.readLine

how to combine and sort two different tables together in Mysql

谁都会走 提交于 2020-01-15 23:43:30
问题 I have table A: id username firstname event_date 1 Ben lori 2014-01-27 2 Ben lori 2014-01-04 3 Mary john 2014-01-28 I have table B: id username event_date 1 Ben 2014-01-23 2 Nicole 2014-01-26 I want the result to be like this: Is there any solution that allow me to combine and sort it according to event_date like one table,like this: 2 Ben lori 2014-01-04 1 Ben 2014-01-23 2 Nicole 2014-01-26 1 Ben lori 2014-01-27 3 Mary john 2014-01-28 so that I can use something like while loop or mysql