08-08-2018
Not quite sure about ii) requirement. You want to delete the whole line? You want to truncate the line to contain only 61 fields (I-separated)? Something else?
Could you provide another representative sample of say 10 fields requirement (instead of 61) and provide a desired output?
Thanks
10 More Discussions You Might Find Interesting
1. HP-UX
For counting the occurences of specific character in the file
I am issuing the command
grep -o 'character' filename | wc -w
It works in other shells but not in HP-UX as there is no option -o for grep.
What do I do now? (9 Replies)
Discussion started by: superprogrammer
9 Replies
2. Shell Programming and Scripting
I'm trying to count the number of 2 specific characters in a very large file. I'd like to avoid using gsub because its taking too long.
I was thinking something like:
awk '-F' { t += NF - 1 } END {print t}' infile > outfile
which isn't working
Any ideas would be great. (3 Replies)
Discussion started by: dcfargo
3 Replies
3. Shell Programming and Scripting
I need to print lines with character S at nth position in a file...can someone pl help me with appropriate awk command for this (2 Replies)
Discussion started by: manaswinig
2 Replies
4. Shell Programming and Scripting
I need to print lines with character S at nth position in a file...can someone pl help me with appropriate awk command for this (1 Reply)
Discussion started by: manaswinig
1 Replies
5. Shell Programming and Scripting
Hi,
I need to add Pipe (|) at 5th and 18th position of all records a file. How can I do this?
I tried to add it at 5th position using the below code. It didnt work. Please help!!!
awk '{substr($0,5,1) ~ /|/}{print}' $input_file > $temp_file (1 Reply)
Discussion started by: gpaulose
1 Replies
6. Shell Programming and Scripting
I am trying to use sed to replace specific characters at a specific position in the file with a different value... can this be done?
Example:
File:
A0199999123
A0199999124
A0199999125
Need to replace 99999 in positions 3-7 with 88888.
Any help is appreciated. (5 Replies)
Discussion started by: programmer22
5 Replies
7. UNIX for Advanced & Expert Users
Hi,
I need help regarding counting specific word or character per line and validate it against a specific number i.e 10. And if number of character equals the specific number then that line will be part of the output.
Specific number = 6
Specific word or char = ||
Sample data:... (1 Reply)
Discussion started by: janzper
1 Replies
8. Shell Programming and Scripting
I'm looking for what I hope might be a one liner along these lines:
sed '/a line with more than 3 pipes in it/d'
I know how to get the pipe count in a string and store it in a variable, but I'm greedy enough to hope that it's possible via regex in the /.../d context. Am I asking too much? ... (5 Replies)
Discussion started by: tiggyboo
5 Replies
9. Shell Programming and Scripting
Hi, im still new in unix.
i want to ask how to delete character on specific position in line, lets say i want to remove 5 character from position 1000, so characters from position 1000-1005 will be deleted.
i found this sed command can delete 4 characters from position 10, but i dont know if... (7 Replies)
Discussion started by: bluesue
7 Replies
10. Post Here to Contact Site Administrators and Moderators
In file, we have millions of records each of 1000 in length. And at specific position say 800 there is a space, we need to replace it with Character X if the ID in that row starts with 123.
So far i have used the below which is replacing space at that position to X but its not checking for... (3 Replies)
Discussion started by: Jagmeet Singh
3 Replies
HISTORY(5) File Formats Manual HISTORY(5)
NAME
history - record of current and recently expired Usenet articles
DESCRIPTION
The file <pathdb in inn.conf>/history keeps a record of all articles currently stored in the news system, as well as those that have been
received but since expired. In a typical production environment, this file will be many megabytes.
The file consists of text lines. Each line corresponds to one article. The file is normally kept sorted in the order in which articles
are received, although this is not a requirement. Innd(8) appends a new line each time it files an article, and expire(8) builds a new
version of the file by removing old articles and purging old entries.
Each line consists of two or three fields separated by a tab, shown below as :
[Hash] date
[Hash] date token
The Hash field is the ASCII representation of the hash of the Message-ID header. This is directly used for the key of the dbz(3).
The date field consists of three sub-fields separated by a tilde. All sub-fields are the text representation of the number of seconds
since the epoch -- i.e., a time_t; see gettimeofday(2). The first sub-field is the article's arrival date. If copies of the article are
still present then the second sub-field is either the value of the article's Expires header, or a hyphen if no expiration date was speci-
fied. If an article has been expired then the second sub-field will be a hyphen. The third sub-field is the value of the article's Date
header, recording when the article was posted.
The token field is a token of the article. This field is empty if the article has been expired.
For example, an article whose Message-ID was <7q2saq$sal$1@isrv4.pa.vix.com>, posted on 26 Aug 1999 08:02:34 GMT and recieved at 26 Aug
1999 08:06:54 GMT, could have a history line (broken into three lines for display) like the following:
[E6184A5BC2898A35A3140B149DE91D5C]
935678987~-~935678821
@030154574F00000000000007CE3B000004BA@
In addition to the text file, there is a dbz(3) database associated with the file that uses the Message-ID field as a key to determine the
offset in the text file where the associated line begins. For historical reasons, the key includes the trailing byte (which is not
stored in the text file).
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 3782, dated 2000-08-17.
SEE ALSO
dbz(3), expire(8), inn.conf(5), innd(8), makehistory(8).
HISTORY(5)