If you use [ code ] tags, it won't, as you did already
The ^ is the problem. If you replace it with a blank and an asterix " *", it will work, but then it's getting ugly since the leading spaces are not removed.
Is a solution in sed ok too? I can write it more compact than in awk. Else you might have to wait for other people to post. I also had an error in it - i edited my 1st post.
I added the sed thing at the end to remove the lots of blanks out of the line, occuring by the changed input file.
Output should be ok, but not very compact.
Hi there,
I have a couple of files I need to merge. I can do a simple merge by concatenating them into one larger file.
But then I need to filter the file to get a desired result.
The output looks like this:
TRNH 0000000010941
ORDH
OADR
OADR
ORDL
ENDT 1116399 000000003... (2 Replies)
Hi,
Anybody help on this. :(
I want to merge the line with previous line, if the line starts with 7.
Otherwise No change in the line.
Example file aa.txt is like below
122122
222222
333333
734834
702923
389898
790909
712345
999999
My output should be written in another file... (6 Replies)
Hi everyone,
I need help with a merging problem. Basically, I have a file with several lines (in this example 9 lines) such as:
Amie, Jay, Sasha, Rob, Kay
Mia, Frank
Jay, Nancy, Cecil
Paul, Ked, Nancy, 17, Fred
14, 16, 18, 20
9, 11
12, Frank
18, Peter, 62
Nancy, 27
A delimiter is... (3 Replies)
Hello,
i am trying to write a script file in awk which yields me the number of lines,characters and words, i checked it many many times but i am not able to find any mistake in it. Please tell me where i went wrong.
BEGIN{
print "Filename Lines Words Chars\n"
}
{
filename=filename + 1... (2 Replies)
I have an OCR output with some words splitted into single characters separated by blank spaces,
and I want the same text with these words written correctly.
Example:
This is a text w i t h some s p l i t e d W o r d s .
The regular expression for matching splitted words could be something... (5 Replies)
Is there an efficient awk that can count the number of lines that occur in between two tags.
For instance, consider the following text:
<s>
Hi PP -
my VBD -
name DT -
is NN -
. SENT .
</s>
<s>
Her PP -
name VBD -
is DT -
the NN -
same WRT -
. SENT -
</s>
I am interested to know... (4 Replies)
Hello all,
I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person.
In the csv, a person may be listed from one to four times... (9 Replies)
Hi,
I am attempting to merge the following lines which run over two lines using awk.
INITIAL OUTPUT
2019 Sep 28 10:47:24.695 hkaet9612 last message repeated 1 time
2019 Sep 28 10:47:24.695 hkaet9612 %ETHPORT-5-IF_DOWN_INTERFACE_REMOVED: Interfa
ce Ethernet1/45 is down (Interface removed)... (10 Replies)
Discussion started by: sand1234
10 Replies
LEARN ABOUT HPUX
ccat
compact(1) General Commands Manual compact(1)NAME
compact, uncompact, ccat - compact and uncompact files, and cat them
SYNOPSIS
[sfile] ...
[cfile] ...
[cfile] ...
DESCRIPTION
compresses the named files using an adaptive Huffman code. If no file names are given, standard input is compacted and sent to the stan-
dard output. operates as an on-line algorithm. Each time a byte is read, it is encoded immediately according to the current prefix code.
This code is an optimal Huffman code for the set of frequencies seen so far. It is unnecessary to attach a decoding tree in front of the
compressed file because the encoder and the decoder start in the same state and stay synchronized. Furthermore, and can operate as fil-
ters. In particular,
operates as a (very slow) no-op.
When an argument file is given, it is compacted, the resulting file is placed in and file is unlinked. The first two bytes of the com-
pacted file code the fact that the file is compacted. These bytes are used to prohibit recompaction.
The amount of compression to be expected depends on the type of file being compressed. Typical file size reduction (in percent) through
compression are: Text, 38%; Pascal Source, 43%; C Source, 36%; and Binary, 19%.
restores the original file from a file compressed by If no file names are specified, standard input is uncompacted and sent to the standard
output.
writes the specified c_file, compressed by to standard output, without uncompressing the file.
Operands
The commands recognize the following operands:
cfile Compacted file.
sfile Source file to compact or uncompact. If no file names are given, the commands use standard input and sent to the standard
output. places the compacted file in
Access Control Lists (ACLs)
On systems that implement access control lists, when a new file is created with the effective user and group ID of the caller, the original
file's ACL is copied to the new file after being altered to reflect any change in ownership (see acl(5) and aclv(5)). In JFS file systems,
files created by or do not inherit their parent directory's default ACL entries (if any), but instead retain their original ACLs. When a
file being compacted or uncompacted resides on a JFS file system, and the compacted or uncompacted file resides on an HFS file system (or
vice versa), as the result of or the use of or as a filter, optional ACL entries are lost.
WARNINGS
On short-file-name systems, the last segment of the file name must contain 12 or fewer characters to allow space for the appended
DEPENDENCIES
NFS
Access control list entries of networked files are summarized (as returned in by but not copied to the new file (see stat(2)).
AUTHOR
was developed by Colin L. Mc Master.
FILES
compacted file created by compact, removed by uncompact
SEE ALSO compress(1), pack(1), acl(5), aclv(5).
Gallager, Robert G., "Variations on a Theme of Huffman," vol. IT-24, no. 6, November 1978, pp. 668 - 674.
compact(1)