Hi,
1) Sort the file on 2nd column
2) Using SED select the range of lines using pattern
---------- Post updated at 07:28 AM ---------- Previous update was at 07:15 AM ----------
Hi,
You may want to use the -T <directory> option to force sort to use a scratch directory that has enough free space. By default it uses TMPDIR - usually /tmp or var/tmp.
If you need to sort the file quickly use -y option with no argument for the option. This starts sort with the maximum free memory allowed or available.
---------- Post updated at 04:47 AM ---------- Previous update was at 04:13 AM ----------
Thanks, this worked fine.
Another problem is
I have the date in the variable as 20100705 and 20100706.
How to convert the date as 5/Jul/2010 and 6/Jul/2010 and pass the dates as a variable in the sed command
sort -k2 tmp.tsv | sed -n '/\[5\/Jul\/2010:06:00:00/,/\[6\/Jul\/2010:09:00:00/p' > tab.tsv
---------- Post updated at 07:02 AM ---------- Previous update was at 04:47 AM ----------
How to pass the variable
$date1
$date2
where $date1 is ' 6\/Jul\/2010'
and $date2 is '7\/Jul\/2010'
sort -k4 tmp.tsv | sed -n '/\[$date1:06:00:00/,/\[$date2:09:00:00/p' > tab.tsv
In the bash below which does execute I am trying to extract the contents of ${id} is 1234, as ${id} stores the variable that changes each time.
After the path is removed the contents of ${id} are stored in pref, so they can be used in the output. Currently I am not able to extract the 1234 in the... (6 Replies)
Hi all;
Here is my file which contains a list of files (recent versions of files are in red). This file is dynamic, files versions can change at any time (versions can increment)
filename
-------------------------------------------------------
... (8 Replies)
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Hi guys
I have a several thousands line file in the following format:
n817
--------------------------------------------------
n842
--------------------------------------------------
n877
--------------------------------------------------
n513
/bb/data/rmt2db.lrl:JBSKDB 31915 75... (4 Replies)
Hi all,
I have a file with many records with information as given below
ID A16L2_HUMAN Reviewed; 619 AA.
AC Q8NAA4; A5PL30; B2RPK5; Q658V4; Q6PID3; Q8NBG0;
DT 20-MAY-2008, integrated into UniProtKB/Swiss-Prot.
DT 20-MAY-2008, sequence version 2.
DT ... (1 Reply)
hi,
i have two files.
file1.sh
echo "unix"
echo "linux"
file2.sh
echo "unix linux forums"
now the output i need is
$./file2.sh
unix linux forums (3 Replies)
Hi,
I have an xml file which will be edited by the user.
I would like to get input from user and insert that at line 40 of the xml file.
PLease can some one help me to know how to insert the text at specified line using shell script. (6 Replies)
HI all,
i have a input file,i have to join 2nd line into firstline and 4th line into 2nd line and so on..
for this we also consider odd no. of line.It's operate on original input file but output file should temp file.
like ..
filename=cdr.cfg
line1
line2
line3
line4Desired output should be... (9 Replies)
I have two files
file A which have a number in every row and file B which contains few hundred thousand rows with about 300 characters in each row (csv)
What I need is to extract whole rows from B file (only these which numbers are indicated in A file)
I also need to use cygwin.
Any... (7 Replies)