This is what i came with. If i correctly understood your question.
You have a file like :
PROCESS1 DATE=130813 TIME=130503 BATCHNO=0000000014
PROCESS1 DATE=130813 TIME=130503 BATCHNO=0000000009
PROCESS1 DATE=130813 TIME=130503 BATCHNO=0000000017
And you need to order it by the BATCHNO as in :
PROCESS1 DATE=130813 TIME=130503 BATCHNO=0000000009
PROCESS1 DATE=130813 TIME=130503 BATCHNO=0000000014
PROCESS1 DATE=130813 TIME=130503 BATCHNO=0000000017
Hope this will help you. Feel free to modify the script to put the file in another path.
Code:
#!/bin/bash
#Date :
#Author
#Purpose : Sort batch file
#Usage : ./sortbatch.sh <batchfile>
BATCHFILE=$1
ORDEREDBATCH=`pwd`/ordered_`date +%F_%H:%M`_$BATCHFILE
#Verify if a file was given
if [ $# -lt 1 ]; then
echo "Usage : ./sortbatch.sh <batchfile>"
exit 1
fi
#Verify if the file exists
if [ ! -e $BATCHFILE ]; then
echo "File does not exist"
exit 1
fi
#Read batch numbers
BATCHNRS=`awk '{print $4}' $BATCHFILE | sort | uniq`
#Copy to another file the lines in order of the batch number
for i in $BATCHNRS; do
awk -v batch="$i" '{if ($4 == batch ) print $0}' $BATCHFILE >> $ORDEREDBATCH
done
#End
Hi all,
I am new to unix shell scripting and I am trying to append batch number that comes in Trailer record to the detailed record.
TR|20080312|22881 |000000005|20080319|2202
LN|20080312|077777722220 |0000100000017|ABS
LN|20080312|000799439326 |0000709943937|AA
TR|20080313|22897 ... (6 Replies)
Hi,
Below is my script which creates a file:
#!/bin/sh
if
then
echo "Enter bill period "
echo "Syntax: sh cpd.sh G08"
exit
fi
sqlplus uname/pwd@dbname <<EOF
set WRAP off
set FEEDBACK off
set PAGESIZE 0
set VERIFY off (14 Replies)
Hi guys I need you ,please help me
i have to do this for tomorow and i don't understand how to do
Q1 : Order the words of RADIO.txt by frequency
Q2 : Order the words of RADIO.txt in alphabétique order
Q3 : Order the words of RADIO.txt par ordre "rhymique" (exemple, put togeder words which are... (1 Reply)
With an input file like this:
How can I get an output like this?
(In the quoted examples, the "_" sign represents an empty space)
Note that there are some minus signs and no spaces, in the example above the first character of the first line is an empty space, so each number spans 10... (16 Replies)
Is it possible to re-order certain rows as columns (of large files).
Few lines from the file for reference.
input
Splicing Factor: Tra2beta, Motif: aaguguu, Cutoff: 0.5000
Sequence Position Genomic Coordinate K-mer Score
97 chr1:67052604 uacuguu 0.571
147... (3 Replies)
Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below.
I am on a solaris server btw.
Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose.
... (2 Replies)
Thanks for RudiC for his extraordinary help on organizing files in a batch of 10 using below code.
FL=($(ls));
for ((i=0;i<=${#FL};i++)); do
for j in ${FL:$i:10};
do
$batch ${j} ${j}.txt
done;
echo "Pausing for next iteration";
echo... (6 Replies)
Discussion started by: busyboy
6 Replies
LEARN ABOUT DEBIAN
ibid-objgraph
IBID-OBJGRAPH(1) Ibid - Multi-protocol Bot IBID-OBJGRAPH(1)NAME
ibid-objgraph - Memory usage graph generation utility for Ibid
SYNOPSIS
ibid-objgraph [options...] logfile type...
ibid-objgraph -e TIME [options...] logfile
ibid-objgraph -h
DESCRIPTION
This utility is for graphing object-type usage from an Ibid bot configured to log such usage.
Matplotlib is required for graphing.
OPTIONS -e TIME, --examine=TIME
Examine the object usage at time TIME, and print a sorted list of type statistics at that time. This function can be useful in
determining which types to graph, when chasing down a detected leak.
-o FILE, --output=FILE
Output to FILE instead of displaying interactive graph GUI. FILE can be any format supported by Matplotlib, detected by the file
extension.
-d DPI, --dpi=DPI
When outputting in raster formats, use DPI output DPI.
-h, --help
Show a help message and exit.
FILES
logfile
A log file generated by loading the memory plugin into Ibid, which will periodically log object usage. It can be gzip compressed,
if the filename ends in .gz.
SEE ALSO ibid(1), ibid-memgraph(1), http://ibid.omnia.za.net/
Ibid 0.1 March 2010 IBID-OBJGRAPH(1)