General :: Sort .txt File By The Numerical Order Of Column?

Mar 22, 2010

I have this .txt file

3183630 R
3574216 W
5264994 M
2656889 A

I want to sort it by the numerical order of column. After sort, I wish to get output like

2656889 A
3183630 R
3574216 W
5264994 M

anyone knows how to use sort to do that? or any other command?

View 6 Replies


ADVERTISEMENT

General :: Sorting A First Non-numerical Column In A File?

Jul 13, 2011

I have a file like:

ER- V67
ER+ V68
ER- V69
ER+ V70

[Code]....

I am using the code:

sort -k1

but it prints it by sorting the second column.

View 8 Replies View Related

General :: Use Sort Command For Its Ascending Order And Descending Order?

Aug 18, 2010

in my text file of 5 columns 2 column is in DDMMYYYY format. (ie DATE OF BIRTH). how to use sort command for its ascending order and descending order.

Is the same can be use for the date format YYYYMMDD ?

View 3 Replies View Related

Programming :: Php - Sort Numerical Descending Then By Alphabetical?

Mar 10, 2009

Using PHP 5.x. I would like to sort a set of values first numerically, then alphabetically. For example, here's my code so far:

Code:

<?php
print "<p style="font-family:verdana;font-size:10pt">
";
$myArray = array("1223:starfruit", "34112:oranges", "1223:zucchini", "321:apples", "34112:pears", "1223:tomatoes");

[code]....

I have fiddled with array_multisort but I can't seem to get my head around it or the many sort routines in PHP.

View 3 Replies View Related

General :: How Do I Sort Output Of Du By Its First Column

Mar 30, 2010

How do I sort the output of du by its first column. I issue the command this way:$ du.Is there a way?

View 5 Replies View Related

General :: Sort The 3rd Column In A Table Numerically

Jun 22, 2010

i wanna sort the 3rd column in a table numerically ( no actual borders...only tabs seperating the columns)
it should be something like this but i cant get it right

Sort -u +1 -3 results

the file is called results

View 7 Replies View Related

General :: Save / Sort Files In Sequential Order Sector By Sectyor

Aug 26, 2010

I have a china phone which has mp3 player and unfortunately it reads the file names in its memory card in sequential order according where the file is saved. The file system is NTFS. cod

**Note: DDD song was last because I saved AAA to EEE songs then later added DDD song

Then suddenly i deleted BBB song and replaced it with FFF song code...

This is kinda lame. but the OS of the phone has no capability sorting the file according to filename in its built in mp3 player.

my question is how can I sort the files sector by sector(is my term right?) so the lame mp3 player would read the files finally in alphabetically sorted order. I Will plug my phone on my PC

I am using ubuntu 10.4

View 1 Replies View Related

Programming :: How To Sort Two MySQL Table On Date Or Time Column

Jul 27, 2011

I have two different table in a database in mysql that has no share key with each other and I want to sort them with each other on their date time column I mean when I sort it row X of table A that is older that row Y of table B comes earlier.

View 3 Replies View Related

General :: File Name In Separate Column?

Apr 26, 2010

I have some series of files, which actually named bellow

<day_month_yr>_<hh:mm:ss>.<host_name>.<IP.ip.ip.ip>.<log_name>.txt

I want to show this file name below the column may be

Date Time Host_Name IP_address Login_Name
----- ---- --------- ---------- ----------
<day_month_yr> <hh:mm:ss> host_name x.x.x.x log_name
...

View 5 Replies View Related

General :: Calculate 3rd Column Which Should Be Addition Of Value In 1 And 2nd Column?

Jul 19, 2010

How would i calculate following values.Initial file

10 3
20 4
How would i calculate 3rd column which should be addition of value in 1 and 2nd column.File after calculation
10 3 13
20 4 24

View 14 Replies View Related

General :: Extract 5th Column From A File Without The Header?

Oct 15, 2010

How can I extract 5th column from a file without the header.

View 5 Replies View Related

General :: How To Redirect The Output To Different Column In .csv File?

Apr 25, 2011

I was trying to redirect the output of two variables to different columns of a .csv file in MS excel like this,

Code:
echo "$a $b" > abc.csv
But I am getting both $a and $b in the same column, is there anything I can use instead of to move the value of $b to the next column? Or is there a good different approach to do it?

View 2 Replies View Related

General :: Text File Column Editing

Jul 17, 2011

I have 2 large text files , one looks like this:

<contact type="1">blahblah@hotmail.com</contact>
<contact type="1">blahblah2@hotmail.com</contact>
<contact type="1">blahblah3@hotmail.com</contact>

The other is a list of emails in single column format like this:

emailaddy@hotmail.com
emailaddy2@hotmail.com
emailaddy3@hotmail.com , etc

Is there a command to delete all the blahblah emails from text file 1 and replace them with the ones from text file 2?

Or maybe a linux version of 'Csved' which has the ability to add,remove,insert columns?

View 5 Replies View Related

General :: Recreating A Column Byte-based File?

Nov 5, 2009

I have a file that stores employee login IDs, names, types, and permissions. Our software reads the information based on byte-columns, so it reads a column as any ASCII character (spaces, letters, numbers, punctuation, etc.). I want to create a web-interface for adding and removing users, and storing the data in a MySQL database. However, if I am creating the files from the MySQL output, I need a way to write to specific column locations in the file ...

User ID: Columns 1-4
User Name: Columns 6-30
Type: 32-40
Permissions: 42-45

I want to use a scripting language, preferably C-Shell, to call MySQL for the data and write the data to the correct columns of the file. I wrote a script that takes the data from the file, and dumps it into the MySQL table, so maybe I can pad the remaining space in the table column to fill with spaces ...

View 12 Replies View Related

Ubuntu :: Way To Manually Sort Order Of Places

Jan 10, 2010

Is there any way to manually sort the order of Places (KDE's "bookmarks") that show up in the side panel of Dolphin, or to have it automatically sorted e.g. alphabetically?One might think such a feature, if it existed, to be well-documented and easily-accessible.

View 5 Replies View Related

Ubuntu :: Change Sort Order In Nautilus?

Feb 12, 2011

How do you change the sort order in Nautilus? I want it to look like this code...

View 10 Replies View Related

General :: Check Quality Of A Specific Column In A Tab-delimited File?

Mar 8, 2010

shell commands for such two goals?

In a tab-delimited file,

Code:
1aIa11aa
2bIIa22aa
1cIIIaabcaa
4dIVaabcaa

1. How can I find the non-unique values in the 1st column (1, in this case)?

2. How can I find the non-integer values in the 5th column (abc, in this case)?

View 3 Replies View Related

Software :: Get Nautilus To Sort Filenames In Lexicographical Order?

Mar 14, 2010

I have a bunch of files named in hexadecimal, which get displayed in order 0A, 0B, 0C, ..., 0F, 01, 1A, 1B, ..., 1F, 02, 2A, ... 2F, 03, 3A, ..., 9F, 10, 11, 12, ..., 99, A0, ...

How do I get them displayed in the correct order?

View 1 Replies View Related

General :: Awk Gsub() Command - String (column) Manipulation - Replace The Value Of The $1 Column In The Awk Print String?

Mar 7, 2010

i use this script to get the time and date of back and fourth transactions for a particular execution id. I use a substr command on the 5th column to to cut the milli seconds off the time value. - otherwise the times would look like 08:30:04.235

grep <executionID> <auditfile> | awk '{ print $1, $2, $3, $4, substr($5,1,8}
FIX -> Mon 3/1/2010 08:30:04
FIX <- Mon 3/1/2010 08:32:36
FIX <- Mon 3/1/2010 08:35:08

[code].....

anyhow - i append two sed commands to further clarify the direction of the message.

awk '{ print $1, $2, $3, $4, substr($5,1,8} | sed -e 's/->/ ->IN/g' | sed -e 's/<-/<-OUT/g'
FIX -> IN Mon 3/1/2010 08:30:04
FIX <- OUT Mon 3/1/2010 08:32:36

[code]....

I tried using an awk gsub () command within the string instead of the two seds, but it did not work:

awk '{ print gsub(/<regex>/, <replace with>,$1), $2, $3, $4, substr($5,1,8}

the sed works ok, but it would be cooler to make the replacement within the awk command:

gsub(/->/,-> IN, $1)

Is there a way where i could replace the value of the $1 column in the awk print string?

View 1 Replies View Related

General :: Numerical Encoding Of Text, By Position?

Apr 26, 2010

I have a file of words and want to encode them in a numeric form, based on position.This is best explained by example:
PEOPLE ==> 123152

Reading left to right:
P was first encountered at position 1 so it is encoded as 1.
E was first encountered at position 2 so it is encoded as 2.

[code]...

View 5 Replies View Related

General :: Warning Messages And Numerical Recipes Functions In C?

Jun 19, 2010

I am using some "Numerical Recipes in C" routines in my C code.(I am using ludcmp() & lubksb().)These are used to find inverse of a matrix.After compiling my c code, I get following warning messages.I have not understood them at all. What is the meaning of these and why did they pop up and how to remove them?

Code:
nrutil.h:11: warning: 'sqrarg' defined but not used
nrutil.h:14: warning: 'dsqrarg' defined but not used

[code]....

View 7 Replies View Related

General :: Count The Numerical Digits In Between The Text Using A Command Or A Script?

Jan 1, 2010

I want to count the digits in between the text in a file.

e.g.

write down the form

2.3 3.3 3.0 505.0 0.777E-07

22.3 3.3 5.0 503.0 1.777E-04

Then read this.

How can i do the counting of these digits present in between a text in a file?

View 9 Replies View Related

Programming :: Awk Multiple Column Into Single Column?

Jul 15, 2010

I have a multicolumn datas, like

a1 b1 ... f1
a2 b2 ... f2
. . ... .

[code]...

I would like to make a file with all these data in one column, like

a1
a2
.
.

[code]....

Can it be done with awk or some other command? Also, is it possible then do add another column in front of this one with numbers of the lines (for every previous column), like

1 a1
2 a2
. .
. .

[code].....

View 14 Replies View Related

General :: Script File Fails When Run From Crontab / Sort It?

Dec 29, 2010

Is been a while since I was last here requesting help. Now I need some of that LQ magic. I have a script file that extracts data for a date range, create a zip file for the data and then ftp it to a remote server.
Now the script is working perfectly if it is run manually, but now I want it to execute automatically. So I use the crontab, but for some reason the script fails when run from the crontab.code...

View 3 Replies View Related

General :: Command To Sort A Text File By The Second Word?

May 14, 2010

What is the command to sort a text file by the second word?

View 4 Replies View Related

Software :: Swap The First And Second Column In A File?

Feb 3, 2011

I have a file in the following format

item1 item2 attrbute1, attribute2, line1
item1 item2 attrbute1, attribute2, line2
item1 item2 attrbute1, attribute2, line3
item1 item2 attrbute1, attribute2, line4
item1 item2 attrbute1, attribute2, line5

Question: what command can I use swap item1 and item2 around and keep the attributes in place.
A space seperates the first and second column. The file has many hundreds of lines in which these need to be swapped

Output needs to be as follows:

item2 item1 attrbute1, attribute2, line1
item2 item1 attrbute1, attribute2, line2
item2 item1 attrbute1, attribute2, line3

View 3 Replies View Related

Programming :: Bash Awk Column To End Of File?

Sep 4, 2010

Code:

#!/bin/bash
ls -lhGg | while read line; do echo "$line"; done | awk ' { print $3" "$6 } '

what i want to do is be able to print column 3 and every column greater then 5. Has to be to the end of the line, since different filenames can have different amounts of words in them and the blank space is the separator. my current code works just fine if the file has no blank space.

View 8 Replies View Related

Programming :: Add A Column To A Text File?

Apr 28, 2011

I have a text field that is just list of servers and I need to add the word hostname in front of them... It must be brain fart but I can't think of how to do this. Basically I need this:

server1
server2
server3

To this:

hostname server1
hostname server2
hostname server3

(And I just mean simply the word "hostname")

View 2 Replies View Related

General :: Unable To Play Mp3 - Mp4 File In Rhel 6.0 Beta / Sort It?

Dec 1, 2010

I can't play mp3 from Rhythmbox music player, it says MPEG-1 Layer 3 (MP3) decoder plugin required, and also I can't play mp4 from movie player it says h.264 decoder and MPEG-4 AAC decoder plugin required. what a joke!!! can you imagine for a newbie and for the first time like me use linux operating system find something like that.

View 2 Replies View Related

General :: Unable To Install Crclient Which Is An Executable File For System / Sort It?

May 2, 2010

I'm new to Linux world. I'm using Ubuntu 9.04. I'm unable to go online using Ubuntu because I'm unable to run an executable client application provided by my ISP. I called them and they are not able to help me instlling this client applicatoin for me on my Ubuntu. "I cannot go online untill I install this ISP client application on my Ubuntu." I'm entering my ISPs weblink in this blogpost so that it would be easy for you guys to help me resolving this issue. http://www.spacenetindia.net/download.php This is the weblink where I downloaded that ISP client application from. I clicked on this link and clicked on 24online clients.exe tab located on the left and downloaded linuxclient.gz. Please help me if you find any resolution for this issue. Though I tried downloading Wine but I could not as I cannot go onlnie in Ubuntu. In windows I don't know how to install wine to make it work offline in ubuntu.b

View 14 Replies View Related







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