List of names and their numbers needed to be sorted .TXT file - sorting

I have a list of names (never over 100 names) with a value for each of them, either 3 or 4 digits.
john2E=1023
mary2E=1045
fred2E=968
And so on... They're formatted exactly like that in the .txt file. I have Python and Excel, also willing to download whatever I need.
What I want to do is sort all the names according to their values in a descending order so highest is on top. I've tried to use Excel by replacing the '2E=' with ',' so I can have the name,value then important the data so each are in separate columns but I still couldn't sort them any other way than A to Z.
Help is much appreciated, I did take my time to look around before posting this.

Replace the "2E=" with a tab character so that the data is displayed in excel in two columns. Then sort on the value column.

Related

Power Query - conditional replace/clear entire cell in multiple columns

I'm trying to clear the entire cell if it doesn't contain a given keyword.
I've managed to do this for one column:
Table.ReplaceValue(#"PrevStep",each [#"My Column"], each if Text.PositionOf([#"My Column"],"keyword")>-1 then [#"My Column"] else null,Replacer.ReplaceValue,{"My Column"})
The problem is I need to iterate/repeat that step for a number of columns... the number of columns may vary and column names also may be different every time. I can have all those column names put into a list but I'm not able to use it.
The solution I'm looking for may look like this
for each ColNam in MyColumnsList
Table.ReplaceValue(#"PrevStep",each [#"ColNam"], each if Text.PositionOf([#"ColNam"],"keyword")>-1 then [#"ColNam"] else null,Replacer.ReplaceValue,MyColumnsList)
next
but this is not the VBA code but Power Query M - and of course the problem is with #PrevStep as I would see it like a recursions... again... do not know how to process.
Is the path I follow correct or should it be done some other way
Thanks
Andrew
Unpivot your columns to turn all the columns into two columns. Apply your replacement to the single value column then pivot it back into the original format

Google Sheets split words then sort Alphabetically, Using arrayformula

I have multiple rows, containing varying number of cells, and in each cell I have one or more words.
I'm looking for a way to go row by row:
Splitting the multiple words into single word parts (with space (" ") as the delimiter)
Sort the parts alphabetically
Put the parts back into multiple word cells
Remove duplicates in the row
Already the first, seemingly easy part, gave me issues. Even if I just tried to look at one row, the closest I got was the code below and that inserted strange " " for the one word cells, and also failed to sort
=iferror(arrayformula(transpose(sort(transpose(SPLIT(transpose(B3:3)," "))))),"")
1
I also tried to cut, sort and join the above output using the Query Header trick, but it refuses so sort anything but the first row
=arrayformula(trim(transpose(query(SORT(transpose(B12:D)),,COLUMNS(B12:D)))))
2
I haven't even attempted combining the two things together, considering my epic fails above.
The final input document will have lots more rows and columns, so I also need to make sure this works without any hard coding of row or column numbers.
Any and all help would be greatly appreciated.
I might have something for you. It's a little bit of an odd way to do it, but it could work I think.
Take a look at this sheet.
The original data is in the Original tab in cells B3:J, all the way down.
The Converter tab puts every thing in one column, then there is a "dragdown formula" that'd need to be dragged down a long ways depending on how big your data set it is. The good news is that you can just do it for thousands of rows beforehad and it will remain blank.
the New Data tab has just one formula and will repopulate your data the way it was, but with the resorted words.
Try messing with the data on the Original Data tab as much as you want. see if New Data reflects what you'd want.

Gnumeric Sort function

Can someone please direct me to a detailed explanation (link) of the Gnumeric sort function? The Gnumeric manual is abbreviated and has no examples. I haven't been able to find any appropriate info through the search engines and even Stackoverflow only has half a dozen questions on it which don't suit.
My problem is:
I have a table with rows of dates, names, and columns of data. (pretty straightforward stuff).
I want to sort ALL columns by the NAME column.
That is: keep each row intact for data but move them in the table up or down so that the order is alphabetic by name.
I can do this easily with Libercalc but prefer the feel and simplicity of Gnumeric, yet I have never been able to understand from the drop-down sort menu how to get this done. I can sort any column fine by itself, but can't seem to lock the other data in the row to be taken with it.
This is such a frequent function I'm surprised it's not made clearer in the drop-down menu. That is: Order by column x
The only way one can sort with Gnumeric, apparently, is to move the key column (i.e. in my case the NAME column) to be the left-most column (column A) in the table, and then sort, subsequently moving the columns back into their required format (date and time in first column) as I want it. This seems very clumsy to me and I wondered if there was an easier way of ordering a table in any format (e.g. just as it is imported from the csv file) by simply selecting the column to sort wherever it is in the table, as can be done in LiberCalc?
1) You need to select ALL the columns you want to sort:
menu > data > sort
2) Keep the column with the NAMEs to be sorted, and remove the rest of the columns in:
sort specification

Convert ascii files into normal human-readable file

I have got ASCII files and want to convert them into maybe excel or tab/csv delimited text file. The file is a table with field name and field attributes. It also includes index name, table name and field(s) to index if required depending on the software. I don't think it is necessary to think of this. Well, field name and field attributes are enough, I hope so. I just want the information hidden inside. Can you all experts help me to get this done.
The lines are something like this:
10000001$"WORD" WORD$10001890$$$$495.7$$$N$$
10000002$11-word-word word$10000002$$$$$$$Y$$
10000003$11-word word word$10033315$0413004$$$$$$N$$
10000004$11-word word word$10033315$$$$$$$Y$017701$
The general answer, before knowing your ascii file in details, operating system, and so on, would be:
1 - cut the top n-lines, that containg the information you don't want. Leave the filds names, if you want to.
2 - check if the fields are separated by a common character, for example, one comma ,
3 - import the file inside a spreadsheet program, like Excel or OpenOffice Calc. In OOCalc, choose to import the file, then select the correct separating character
that's all.

extract text from links and insert in new sorted

I have a single html file that's updated and generated frequently. It's a list sorted by names and linked with html that contain numbers in the end like ...#835C or #717.
I would like to extract just the number (no letter) and insert it into a new html file sorted by the number but still linked with the original.
Can you help me make this chore an easy one, thanks?
Here is the file I shortened from the current count of 850. The upper half is original and the lower is what I'd like extracted as an example.
http://selvan777.tripod.com/test/rin.htm
Thanks,
Selvan

Resources