Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sort a las file keep the header as it is Post 302954835 by cjcox on Friday 11th of September 2015 11:48:22 AM
Old 09-11-2015
Operating inline of the file? Hard.

If you can tolerate a stream of output from processing the file twice, then ok. I'm assuming only one ~Ascii in the file.

Code:
sed -n '1,/^~Ascii/p' <test.las; sed  '1,/^~Ascii/d' <test.las | sort -k1,1n

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Add a header to a sort file instruction

Hello, I have a header which I have to add to a sorted file, however if I use cat header sortedfile > newfile, the operation takes 2 minutes as the sorted file is over 400mb. I have noticed that when I sort the 400mb unsorted file, this only takes 14 seconds to create the output. As... (2 Replies)
Discussion started by: clarcombe
2 Replies

2. UNIX for Dummies Questions & Answers

Sort and uniq lines of a file while keeping a header line

So, I have a file that has some duplicate lines. The file has a header line that I would like to keep at the top. I could do this by extracting the header from the file, 'sort -u' the remaining lines, and recombine them. But they are quite big, so if there is a way to do it with a single... (1 Reply)
Discussion started by: Digby
1 Replies

3. Shell Programming and Scripting

Simple sort with header

Hi, Please help with this problem. Somehow does not work for me. test.txt CHR SNP BP A1 C_A C_U A2 CHISQ P OR 19 rs10401969 19268718 C 222 890 T 0.03462 0.8524 0.9857 1 rs10873889 ... (4 Replies)
Discussion started by: genehunter
4 Replies

4. Shell Programming and Scripting

Ignore Header and Footer and Sort the data in fixed width file

Hi Experts, I want to Sort the data in fixed width file where i have Header and Footer also in file. I m using below commad to do the sort based on field satarting from 15 position to 17 position , but it is not ignoring the Header and Footer of the file while sorting. In the output i am... (5 Replies)
Discussion started by: sasikari
5 Replies

5. Shell Programming and Scripting

sort a report file having header and footer

I am having report file with header and footer . The details in between header and footer are separated by a pipe charater. I want to sort the file by considering multiple columns in between header and footer. pls help (4 Replies)
Discussion started by: suryanarayana
4 Replies

6. UNIX for Dummies Questions & Answers

Sort a tab file with header.

How to sort a tab delimited file first on col1 and then on col2. Also I need to keep the header intact. file.txt val1 val2 val3 val4 a b c d m n o p e f g h i j k l ... (3 Replies)
Discussion started by: mary271
3 Replies

7. UNIX for Dummies Questions & Answers

How can i sort a .txt file without loosing the header information?

Hi, I'm trying to sort 2 different .txt tab delimited files with the command line: sort -k 1b,1 inputfile > outputfile But doing that i'm also sorting the header (that ends at the end of my file). How can i sort a .txt file without sorting the header but conserving the header in the... (3 Replies)
Discussion started by: alisrpp
3 Replies

8. UNIX for Dummies Questions & Answers

Sort a las file keep the header as it is

I have several las files with a header and each file start Version and text and before the data starts end up with ~Ascii, then the numbers starts: ------------------------------------------------------------------------- Code: ~Version .....text.... ~Ascii 2 abc 230 1 name 1 abc ... (1 Reply)
Discussion started by: tk2000
1 Replies

9. Shell Programming and Scripting

Sort and Split file with header and custom name

Hi, I am using SUN SOLARIS (SunOS sun4v sparc SUNW, T5240). I have a huge data file with header and trailer. This file gets used into an ETL process. ETL skips the header record (which is the first record of the file) and loads the rest of the record. The file can be delimited (comma,... (5 Replies)
Discussion started by: Saanvi1
5 Replies

10. Shell Programming and Scripting

Sort without Header and Trailer

Hi , My UNIX system is SUN Solaris. I am trying to do a simple thing as described below. I have a PIPE delimited file that has header and trailer. So the file is something like below: Test1.txt looks like something below: field_data1|field_data2|and some more data --Header ... (5 Replies)
Discussion started by: Saanvi1
5 Replies
ost::HEXdump(3) 					     Library Functions Manual						   ost::HEXdump(3)

NAME
ost::HEXdump - Produces a dump of a buffer in a hexdump way with its code Ascii translation and relative buffer address. SYNOPSIS
#include <applog.h> Public Member Functions HEXdump (const unsigned char *buffer, int buff_len, int max_len=200) HEXdump constructor. virtual ~HEXdump () HEXdump destructor. const char * c_str () const const char* cast provided for conveneince. std::string str () string cast provided for conveneince. Protected Attributes std::string _str output string Friends std::ostream & operator<< (std::ostream &out, const HEXdump &hd) operator << Detailed Description Produces a dump of a buffer in a hexdump way with its code Ascii translation and relative buffer address. For instance: 0000000 - 77 98 21 49 0e 00 05 00 40 1c 01 1c 2f 00 00 00 w.!I....../... Constructor &; Destructor Documentation ost::HEXdump::HEXdump (const unsigned char *buffer, intbuff_len, intmax_len = 200) HEXdump constructor. Parameters: buffer buffer to be 'hexdumped' buff_len buffer length max_len max number of bytes to be 'hexdumped'. Usefull to truncate output. mas_len=0 does prints all. virtual ost::HEXdump::~HEXdump () [inline], [virtual] HEXdump destructor. Member Function Documentation const char* ost::HEXdump::c_str () const [inline] const char* cast provided for conveneince. std::string ost::HEXdump::str () [inline] string cast provided for conveneince. Friends And Related Function Documentation std::ostream& operator<< (std::ostream &out, const HEXdump &hd) [friend] operator << Parameters: hd hexdump. Returns: application logger stream Member Data Documentation std::string ost::HEXdump::_str [protected] output string Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::HEXdump(3)
All times are GMT -4. The time now is 05:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy