Sponsored Content
Top Forums Shell Programming and Scripting Sort by id value in every two rows Post 303035780 by RudiC on Monday 3rd of June 2019 05:09:41 AM
Old 06-03-2019
Try also
Code:
$ paste -sd"\t\n" file | sort -nt\" -k2 | tr $'\t' $'\n'
#INFO id="18 london" logo="http://lx.yy.zz
http://11.22.77
#INFO id="21 michigan" logo="http://mx.yy.zz
http://11.22.55
#INFO id="133 texas" logo="http://tx.yy.zz
http://11.22.48
#INFO id="299 paris" logo="http://px.yy.zz
http://11.22.00

These 4 Users Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sort, group rows

I wrote script in bash which generates this report: User1,admin,rep,User2,shell,path1,x1,r1 User2,admin,rep,User7,shell,path1,x1,r1 User3,admin,rep,User4,shell,path1,x1,r1 User4,admin,rep,User3,shell,path1,x1,r1 User5,admin,rep,User1,shell,path1,x1,r1 User6,admin,rep,User5,shell,path1,x1,r1... (6 Replies)
Discussion started by: patrykxes
6 Replies

2. Shell Programming and Scripting

Deleting specific rows in large files having rows greater than 100000

Hi Guys, I need help in modifying a large text file containing more than 1-2 lakh rows of data using unix commands. I am quite new to the unix language the text file contains data in a pipe delimited format sdfsdfs sdfsdfsd START_ROW sdfsd|sdfsdfsd|sdfsdfasdf|sdfsadf|sdfasdf... (9 Replies)
Discussion started by: manish2009
9 Replies

3. Shell Programming and Scripting

Sort the multi column rows

abc xyz - - - - - - - - - - - How to sort the second column in ascending order. (2 Replies)
Discussion started by: sandy1028
2 Replies

4. Shell Programming and Scripting

Split single rows to multiple rows ..

Hi pls help me out to short out this problem rm PAB113_011.out rm: PAB113_011.out: override protection 644 (yes/no)? n If i give y it remove the file. But i added the rm command as a part of ksh file and i tried to remove the file. Its not removing and the the file prompting as... (7 Replies)
Discussion started by: sri_aue
7 Replies

5. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

6. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

7. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

8. UNIX for Dummies Questions & Answers

Converting Columns To Rows Sort Of

Hi I'm a UNIX awk and sed novice at best. I'm trying to creat a .csv file so it can be graphed in Excel. Tried various xargs, awk, sed and paste but just can't seem to get the data to line up. Not sure if this is beyond for a question in these forums. Any help would greatly be appreciated. Have... (4 Replies)
Discussion started by: jimmyf
4 Replies

9. Shell Programming and Scripting

Moving or copying first rows and last rows into another file

Hi I would like to move the first 1000 rows of my file into an output file and then move the last 1000 rows into another output file. Any help would be great Thanks (6 Replies)
Discussion started by: kylle345
6 Replies

10. UNIX for Dummies Questions & Answers

Sort tab delimited file according to which rows have missing values

Hello! I have a tab delimited file with values in three columns. Some values occur in all three columns, other values are present in only one or two columns. I would like to sort the file so that rows with no missing values come first, rows with one missing values come next, and rows with two... (9 Replies)
Discussion started by: MBarrett1213
9 Replies
LINUX_LOGO(1)						      Debian GNU/Linux Manual						     LINUX_LOGO(1)

NAME
linux_logo - Color ANSI penguin logo w/ system information. SYNOPSIS
linux_logo [-h | -v ] [-a ] [ -b | -c] [-d] [-D file] [-e file] [-f] [-g | -l] [-k] [-i] [-n] [-p] [-s] [-u] [-x] [-y] [-o Num] [-t string] [-L num | NAME | list | random_xy] [-F format] DESCRIPTION
linux_logo is a program that generates a color ANSI picture of a penguin which includes some system information obtained from the /proc filesystem. OPTIONS
-h Show summary of options. -v Show version of program. -ascii -a Display the logo as monochrome ascii. -banner -b Display the banner-style logo. -classic -c Display the original penguin logo. -d Disable "prettying" of output -D filename Use logo from "filename" -e filename Use cpuinfo from "filename" for debugging purposes -f Force the screen clear before drawing the logo. -F STRING Use custom output STRING for sysinfo. See below for more info. -g Display only the system infomation. -i Ignore the ~/.linux_logo and /etc/linux_logo.conf config files -k Keep sysinfo flushed-left (non-centered) -l Display only the logo. -L ... Custom logo options. See LOGO SELECTION below -o Num Shift output Num spaces to the right -p Preserve cursor location -s Skip the BogoMips test [ speeds up display on non-Linux platforms ]. -t string Display an arbitrary string -u Display the system uptime. -w val Set screen width to val -y Display the load average. PROCESSOR INFORMATION
CPUINFO The cpuinfo supplied in /proc/cpuinfo is not always usable by linux_logo. If the cpuinfo for your microprocessor generates ugly output, send the output from your /proc/cpuinfo to the author. FORMAT The format string special sequences start with # (use ## to print #). All other characters, except for , are printed as is. Seq Description Output ---------------------------------------------------------------- ## # #B Bogomips 374.37 #C Compiled Date #47 Fri Jan 8 10:37:09 EST 1999 #E User Text My Favorite Linux Distribution Displayed with -t #H Hostname deranged #L Load average Load average 0.04, 0.01, 0.01 #M Megahertz 188Mhz where supported #N Number of CPU's Two #O OS Name Linux #P Processor or Processors Processor #R Ram 64M in Megabytes #S Plural s #T Type of CPU K6 #U Uptime Uptime 10 hours 59 minutes #V Version of OS 2.2.0-pre5 #X CPU Vendor AMD \n carriage return Notes: o The letter after the # must be capitalized. o Options not available are silently ignored. o Megahertz only available on some platforms and newer kernels. o See defaults.h on how to have #N report in non-english numbers. o Plural [#S] gives nothing if there is 1 cpu, gives 's' otherwise. o The "-y" and "-u" [display uptime and load average] command line options don't affect the output if a custom format is used. The default banner format is: "#O Version #V, Compiled #C #N #M#X#T Processor#S, #R RAM, #B Bogomips Total #H " The default banner format displays the following on the author's computer: Linux Version 2.2.0-pre5, Compiled #47 Fri Jan 8 10:37:09 EST 1999 One 188MHz AMD K6 Processor, 64M RAM, 374.37 Bogomips Total deranged Another example would be: linux_logo -F "Redhat Linux 5.2 Kernel Version #V #U #L " which would display: Redhat Linux 5.2 Kernel Version 2.2.0-pre5 Uptime 11 hours 4 minutes Load average 0.00, 0.00, 0.00 LOGO SELECTION The -L command line option is used to choose which logo to use. o "-L list" will list all of the logos available o "-L NAME" will display the logo with name NAME. o "-L NUM" will display logo with number NUM (deprecated) o "-L random_xy" will pick a logo at random, with criteria xy. When you replace x with the letter: b : pick a random banner mode logo c : pick a random classic mode logo e : pick a logo from either banner or classic When you replace y with the letter: a: pick a random ascii logo n: pick a non-ascii logo e: pick either type of logo So to summarize: "-L random_ba" picks a random ascii banner, "-L random_ce" picks a random classic logo "-L random_ee" picks any logo, etc. DEBIAN
The Debian pre-packaged version of linux_logo includes the Debian logo in addition to the 'Classic' and 'Banner' logos. The Debian logo is the default logo unless one of the other logos is specified on the command line. CONFIG FILES
~/.linux_logo and /etc/linux_logo.conf can be filled with command line options and will be parsed before the actual command line SEE ALSO
/usr/doc/linux_logo, http://www.deater.net/weave AUTHOR
Vince Weaver <vince@deater.net>. This manual page was written by Steve Kostecke <steve@debian.org>, for the Debian GNU/Linux system. Debian 7 July 2007 LINUX_LOGO(1)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy