Programming :: Reorganizing / Sorting Spreadsheet Using Shell?

Jun 25, 2011

I have a problem to reorganize a spreedsheat using shell, I want to use "sort" to organize the first column (descending scale) and then organize the second column in an ascending scale related to the first column so that the final result should be that one displayed at the end of the message. I have tried "sort -r -n" but I don't know how to reorganize the second column related to the first column.

40.0 20.0 9
40.0 15.0 8
40.0 10.0 14
40.0 5.0 12
39.0 15.0 18
39.0 10.0 19
39.0 20.0 5
39.0 5.0 4
41.0 20.0 10
41.0 15.0 12
41.0 5.0 8
41.0 10.0 7

Solution:
41.0 5.0 8
41.0 10.0 7
41.0 15.0 12
41.0 20.0 10
40.0 5.0 12
40.0 10.0 14
40.0 15.0 8
40.0 20.0 9
39.0 5.0 4
39.0 10.0 19
39.0 15.0 18
39.0 20.0 5

View 14 Replies


ADVERTISEMENT

Programming :: Sorting 2 Dimension Array?

Aug 5, 2010

how to sort the 2 dimensional array below by column 1 then by column 2?

22 55
2222 2230
33 66
44 58
222 240

[Code].....

this is a small part in my awk script. the input data is not in file, but it was manipulated in my script.

View 6 Replies View Related

Programming :: List Sorting In Python?

May 10, 2011

I have a list of list and I'd like to sort the list according to the last value of each row.

Let's say we have the list

L1 = [ [1,2] , [4,6] , [78,-3] ]

I wish to get

L2 = [ [78,-3] , [1,2] , [4,6] ]

Is there a simple way to do that in python?

View 4 Replies View Related

Programming :: Sorting A Dictionary File?

Nov 1, 2010

I have this dictionary file that has this format:

SUBSTITUTE_VALUE, Real Value
SUBSTITUTE_VALUE_2, Real Big Value
SUBSTITUTE_VALUE_HECL, Hardware Abstract
SUBSTITUTE_V, Valley Mem

I want to sort this file so the LONGEST Substitute Values are listed at the top ( so SUBSTITUTE_VALUE_HECL would be first in the list). Obviously I want to keep the related values tagging along with them, so the whole first line would be
SUBSTITUTE_VALUE_HECL, Hardware Abstract

Playing with sort This has me pretty close: sort dict.file -k1.1n,1

View 2 Replies View Related

Programming :: (PHP / XML) Sorting Through Multi Dimensional Array

Sep 17, 2010

I am parsing through XML documents with a PHP script and creating an array because, as far as I know, I can manipulate arrays better than the features DOM gives me. That part is not as important, though. The array it produces though is multi-dimensional, but somewhat inconsistent. If I have the following XML:

PHP Code:
<domains> <domain>
<title>google.com</title> <bookmarks>
<bookmark>maps.google.com</bookmark>
<bookmark>news.google.com</bookmark>
<bookmark>mail.google.com</bookmark>
</bookmarks> </domain> <domain>
<title>bankaccount.com</title>
<bookmarks> <bookmark>login.bankaccount.com</bookmark>
</bookmarks> </domain> </domains>

To call the first bookmark from the first domain, it would be:
PHP Code:
$array['domains']['domain'][0]['bookmarks']['bookmark'][0]
To call the first bookmark from the second domain, it would be:
PHP Code:
$array['domains']['domain'][1]['bookmarks']['bookmark']

The problem is, I want to simply call bookmarks through a simply 'foreach()' or 'for()' function and the lack of consistency might be a problem, but the fact that some levels have a '0' array key and others do not is causing a problem.

View 1 Replies View Related

Programming :: QListView - Way To Turn Off / Reverse Sorting?

Aug 23, 2010

QTreeView and QTableView have sort functions, but I need to sort a QListView, and for there to be no way for the user to turn off or reverse sorting.

View 11 Replies View Related

Programming :: Sorting Specific Values From An XML File

Sep 21, 2010

I need a shell script which gathers the data from a remote XML file and then displays it according to my needs.. I need this for my job due to the fact that I need to keep track price changes of euro, usd, gold, etc. The XML file I am talking about is located at this page: here. The reason I am posting the URL is that I need to use curl to get this file and it does NOT have newlines after each tag. I thought that that would be a problem. Here is what I need from the script: 1) curl to get the page 2) make use of sed, awk, etc. to display its contents in a more structured and readable manner as shown below:

A: 64.125 (% -0.26)
B: 81.130 (% -0.32)
C: 1.4930 (% 0.00)
D: 1.9590 (% 0.36)

View 5 Replies View Related

Programming :: PHP - Sorting Multi Dimensional Arrays By One Column

Mar 17, 2009

I just started programming in PHP so I haven't figured out how to do this yet, but I have a multi-dimensional array that I need to sort by one column. That's fine...but I need the sort to ignore case! Right now I have it sorted by 'name' (the other column is 'uid').

The problem is that by the default the sort is case-sensitive so the array looks like this:
Code:
Apple 4015
Banana 4011
Cherry 4045
avocado 4046

I want to be able to sort the the 'name' column in a case-insensitive manner so that the array actually looks like:
Code:
Apple 4015
avocado 4046
Banana 4011
Cherry 4045

How to accomplish this? Just FYI I'm not actually sorting the PLUs for fruits...but it was a simple example. I'm actually doing this for a Facebook application.

View 2 Replies View Related

Software :: Thoughts On Reorganizing MP3 Collection?

Mar 14, 2010

Last spring I graduated college. I lived in a party house, and being skilled in computers, I decided to build a media center for me and my five roomies. The thing worked great; MythTV for television, and a thin client in the kitchen to DJ the music. I had a samba share available so my room mates could just dump their music collection from their machines on to the media center. Adding new songs was their problem, and not mine. As you can imagine, nobody really wanted to organize the music to well. Many of them just dumped in the tunes and then searched for it in GMPC (a great interface for MPD by the way).

So over a year later, I have 150GB+ of music which is mostly unorganized. I need a way to put some order to the chaos... I tried using EasyTag for a while. Don't get me wrong, it's a great program. But sorting through every directory and song would take me DAYS, time I just don't have.I need a way to SAFELY rename and organize all of the music into a logical file structure. My initial thought was to just connect an external hard drive, copy it all into iTunes on some laptop, and then recopy the then organized iTunes database back onto the media center.

View 7 Replies View Related

Debian Configuration :: Reorganizing Disks In MD RAID Array

Mar 4, 2010

I'm trying to do some RAID managing with mdadm. I would like to sync my spare disk and then remove it from the array for making a backup out of it with dd command (the best way i can think of to get the current image of the whole system as it can't be done using the active RAID as source, because is constantly in use and changing). So, I have RAID1 array with 1 spare and 2 active disks (configuration listed below). Now I would like to force spare to sync and then remove it from array, although not faulty.

However, mdadm man page states:
"Devices can only be removed from an array if they are not in active use. i.e. that must be spares or failed devices. To remove an active device, it must be marked as faulty first."

So, I'd have to mark a disk as faulty (which it is not) to be able to remove it from array. There seems to be several people reporting that they can't remove this faulty flag accidentally given to a drive. And mdadm does not give direct for such operation. Isn't there a way I could remove and add disks whenever feeling like it?? One way would be open the cover and physically remove the disk. I'm not taking the risk, though. System is almost always in use, so there is not much chance for me to power off for temporary disk removal.

RAID CONFIGURATION:
~# mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Fri Aug 4 17:38:26 2006
Raid Level : raid1
Array Size : 238950720 (227.88 GiB 244.69 GB)

View 3 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?

Example:

Code:

>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

Programming :: Prevent "leak" Into Shell From A Customized Shell Menu Script?

Dec 15, 2009

I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.

View 11 Replies View Related

Programming :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

Programming :: Possible To Assist In Programming Shell Scripts?

May 17, 2010

Is it possible to assist in the programming Shell Scripts
Job:
To send a message to the email,All orders written in Terminal or ssh
example : ls , pwd , cat , and other

View 1 Replies View Related

Programming :: How To Turn Non-interactive Shell Into Interactive Shell?

Feb 4, 2011

I have a situation where I am in a non-interactive shell. I have tried from within my non-interative shell to spawn an interactive shell but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.

Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.

View 2 Replies View Related

Software :: How To Generate PDF From Spreadsheet

Dec 30, 2010

In OpenOffice how do you generate a PDF from the current sheet in a spreadsheet. This spreadsheet has 40 sheets. But I want to get a PDF of sheet8 only. When I "Export as PDF", I get a PDF file that contains all 40 sheets.

View 3 Replies View Related

Ubuntu :: List Of Directories To Spreadsheet

Oct 23, 2010

I have a large music directory that I'd like to somehow acquire, or generate, a list of each sub-folder within it, and then somehow get the list into a spreadsheet format. Is there a way to do this?

View 1 Replies View Related

Ubuntu :: How To Use Formulas In OneOffice.org Spreadsheet

Dec 29, 2010

I'm trying to create a simple times table on OpenOffice.org Spreadsheet

I'm trying to use the "$" in the top tab (input line) i.e.

Quote:
=A3*$B2$
Quote:
=A3*$B3$

[Code].....

To make the question clearer. When I used to use Microsoft Excel in Windows I would do just as I said in the above and I would be able to construct simple multiplication tables to more bigger/harder to memorize kind of type. And that would be by dragging the rectangle from it's bottom-right corner

Screenshot-5.jpg
Screenshot-4.jpg

So my question is what's the alternative OpenOffice.org Spreadsheet symbol for the "$" symbol used in the formula bar in Microsoft Excel?

View 4 Replies View Related

Ubuntu :: Open Challenge In OOO Spreadsheet?

Mar 21, 2011

I have used the words 'Open Challenge'.I have attached a spreadsheet 'Sample file for filter.ods'.TASK: In a presentation, I would like to show what are the Topics of India on Day-1 , Day-2 , Day-3 , Day-4. That means I am going to Filter India and (Day-1, Day-2, Day-3, Day-4).

View 7 Replies View Related

Ubuntu :: Spreadsheet Becomes ZIP Folder When Renamed?

Aug 7, 2011

I had a really important spreadsheet with my student's grades in it. I wanted to rename it so I right clicked and renamed (at least that's what I thought I did). After I looked again, the file somehow became a zip folder. I inside the zip folder are a bunch of files but I can't the spreadsheet anywhere! Here are some screens:

View 2 Replies View Related

Software :: Spreadsheet Program For Log And Semilog?

Oct 23, 2010

In my prior experience with spreadsheet software on Linux, Gnumeric has been the most useful for my daily tasks. However, I am now required to plot scientific data and I need to be able to plot log-log graphs and semi-log graphs (graphs with logarithmic scales for x- and y- axes) and I cannot seem to find a program that will "fit the bill".

Gnumeric allows for log-log and semi-log graphs by selecting the logarithmic scale for the x- or y- axis, however it automatically does the log to a base 10 and I need to do log graphs to base n (n being a variable that I can set, whether it is 1.5 or 150000).I know this is possible in MS Word (somebody showed me a few weeks ago), but I want a Free (as in speech and as in beer) program that will allow me to plot log-log and semi-log to different bases. OpenOffice.org is also not useful for doing this as it plots to the base 10. Also tried labplot and qtiplot, they give a few more bases but still no base n

View 6 Replies View Related

Ubuntu :: Openoffice Spreadsheet Hyperlink Path?

May 12, 2010

I'm having some trouble with hyperlinks in openoffice 3.2 spreadsheet, though it may be a begginers problem.

I wrote a script to execute a certain task (in my case, to open an DNA alignment file with bioedit) and then, in openoffice, I assigned a hyperlink button to the path needed to execute the script, which is in my /home ("./script_file"). When I do this the first time, clicking the hyperlink button runs the script perfectly. However, whenever I close openoffice and re-open it afterwards, the hyperlink doesn't work anymore. I've checked and this happens because the original URL, which was "./script_file" changes to /home/user/etc... or /temp/etc... and, obviously the file isn't found. If I manually correct the URL, the hyperlink is functional again... how to fix the URL of an hyperlink so that I won't have to correct it every time I close and re-open the program?

View 1 Replies View Related

Ubuntu :: Open Spreadsheet To Last Cell Edited?

Apr 8, 2011

Is there any way to make an OpenOffice spread sheet open to the last cell that was edited? I have a friend that has a very large spreadsheet, and would like to have it open to where he left off, rather than cell A1. He says excel does, or can be made to do this.

View 3 Replies View Related

Ubuntu :: Converting PDF To ODS Format (OpenOffice Spreadsheet)

May 11, 2011

I know this is more of the Openoffice question but I felt I would find some solution here for this. At my work I am using lot of PDF files which are created using Openoffice Calc (Spreadsheet). I want to convert those PDFs to Calc file again for editing. Currently I am using a windows Machine with able2extract pdf converter for converting PDFs to .xls file. But it is not ideal solution for Linux and Openoffice users here.

View 2 Replies View Related

Ubuntu :: How To View Contents Of Spreadsheet Download

Jun 6, 2011

I'm in an Aussie rules fantasy football competition and someone posted a zip file with relevant stats for players in the under 18 comp, as a guide for selecting possible players in next years team. Never used any of the office applications. I've attached the zip file and this is what the poster said...

In the actual spreadsheet though, there are two sheets. The first is all the raw data which you can order by position (based on me watching the games, and the line-ups listed on the AFL websites), K: H ratio, state etc. The second is a sheet which you can use to compare players.

I find that sometimes it is easier for me to make decisions about which players to pick when the stats are more obvious, so if you are the same, you can use this sheet as well. Anyway, I hope you guys enjoy the spreadsheet and I'll update it after each round. Fixed, I had to change the file from .zip to .xlsx

View 2 Replies View Related

Ubuntu :: Automatically Sorting Files?

Mar 25, 2010

I download files onto my networked file server which is running Ubuntu 9.10.By default, all files are moved into the Downloads folder, I'd like to use a script or program to automatically send them into one of 5 shared folders based on what the file is.For example: archived files would be software by default, .avi or mpeg Videos, and .flac or .ogg would be Music.

View 1 Replies View Related

General :: Sorting A File With A Variable Name?

Jun 27, 2011

I am trying to sort a file, so I can compare it to another file later. I am storing the file name in a variable called curMo. I then call sort $curMo and it hangs for a very long time and I have to quit the process. why this is not working or how to make it work?

Here is part of my code:

#sort this file for this Location
sort -u $curMo -o $curMo.sorted

View 1 Replies View Related

General :: Sorting Files In A Directory?

Jan 6, 2010

I have some files in a directory like

file1.txt
file10.txt
file2.txt

[code]...

View 5 Replies View Related

Ubuntu :: Since Upgrade From 9.04 To 9.10 Cannot Load A Link For An Excel Or Spreadsheet Doc

Mar 29, 2010

since upgrade from 9.04 to 9.10, I cannot load a website link which should load openoffice and then an excel or spreadsheet document.

It recognises that its an "excel" document because it load openoffice spreadsheet, but it loads a blank document without any data in it.

It worked properly in version 9.04?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved