Sponsored Content
Full Discussion: sed/awk script
Top Forums UNIX for Dummies Questions & Answers sed/awk script Post 1663 by Duckman on Thursday 22nd of March 2001 01:13:15 PM
Old 03-22-2001
I have a file with three fields, where the first two fields are of fixed length, left justified, and right padded with spaces. The third field is truncated to the length of the data (max length 5), and possibly contains a single letter. Each field is separated by an additional space. How can I search only the third field for a specific letter, say "P", and delete these rows?

Thanks

Duckman
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script Help (sed awk)

Hi there I'am new here and could use some help. I probably haven't used the correct terms but have tried my best. I work for a newspaper who run a database for their classifieds. All the adds are input on an atex system and then each day dumped into three files. (*.eps *.srt *.prn) I'am trying... (1 Reply)
Discussion started by: StiCKmaN
1 Replies

2. Shell Programming and Scripting

sed or an awk script should help

num desc ind code 11 hi,feather y food 121 edible,oil y food 100 meal-pack y food 010 health,prod 120 ... (5 Replies)
Discussion started by: thumsup9
5 Replies

3. Shell Programming and Scripting

awk or sed script

hi guys, perhaps you can help me again I have a file generated with the AIX-tool lparstat the looks like this: %user %sys %wait %idle physc %entc lbusy app vcsw phint ----- ---- ----- ----- ----- ----- ------ --- ---- ----- 21.8 8.8 1.8 67.6 0.17 34.1 9.4 7.22 ... (3 Replies)
Discussion started by: funksen
3 Replies

4. Shell Programming and Scripting

AWK/SED script help

Hi, was hoping someone may be able to help me with a script solution to move one line to another line from my log file: My log file currently looks like this: 01:21:12:383 Request 01:21:12:639 Response 01:21:12:386 Request 01:21:12:639 Response 01:21:12:389 Request 01:21:12:640 Response... (8 Replies)
Discussion started by: jimbobla
8 Replies

5. Shell Programming and Scripting

XML- Sed || Awk Bash script... Help!

Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to take some ideas from people that really know about this! This is my situation I've and xml file with a lots of positional values with another tags... (9 Replies)
Discussion started by: juampal
9 Replies

6. Programming

Shell script using sed or awk

Hi, I want to read a file from the command line and remove all the spaces, tabs in it, replacing it with comma(,), and write it to a new file. can you help me out with this scenario. (1 Reply)
Discussion started by: sudhanshu12788
1 Replies

7. Shell Programming and Scripting

help with writing a awk/sed script

Hi, I thought I am getting pretty good with sed and awk, but now I dont have a way out of this question. I have a table 0.5 16 1.3 14 0.25 15 0.85 16 I want to make a column 3 which contains values that are (corresponding $2 value/sum of all $2). Please help me out here. Thanks. (6 Replies)
Discussion started by: jamie_123
6 Replies

8. Shell Programming and Scripting

awk or sed script to remove strings

Below am trying to separate FA-7A:1, In output file it should display 7A 1 Command am using Gives same output as below format: 22B7 10000000c9720873 0 22B7 10000000c95d5d8b 0 22BB 10000000c97843a2 0 22BB 10000000c975adbd 0 Not showing FA ports as required format... (5 Replies)
Discussion started by: aix_admin_007
5 Replies

9. UNIX for Dummies Questions & Answers

Use of Variables in a sed/awk script

Hi, After looking at the differents post on this forum, I am convinced that I will benefit from the experience of advanced Unix user on some script I have already done for an aeronautical study. Here is one of them : Step 1 : sed -e "s/??/00/g" Base_Awk.txt > Awk_Cut_00.txt4; sed... (11 Replies)
Discussion started by: Marc_Camoc
11 Replies

10. Shell Programming and Scripting

sed or awk script problem

Hi All I am having a file as shown below File1# modyle 1 { test jsj hhsjh 13e3 jsjjs } memP(dbg_trace) { ajjs jsjs jsjs Test(claer) { jsjs (7 Replies)
Discussion started by: kshitij
7 Replies
AR(5)							      BSD File Formats Manual							     AR(5)

NAME
ar -- a.out archive (library) file format SYNOPSIS
#include <ar.h> DESCRIPTION
The archive command ar combines several files into one. Archives are mainly used as libraries of object files intended to be loaded using the link-editor ld(1). A file created with ar begins with the ``magic'' string ``!<arch> ''. The rest of the archive is made up of objects, each of which is com- posed of a header for a file, a possible file name, and the file contents. The header is portable between machine architectures, and, if the file contents are printable, the archive is itself printable. The header is made up of six variable length ASCII fields, followed by a two character trailer. The fields are the object name (16 charac- ters), the file last modification time (12 characters), the user and group id's (each 6 characters), the file mode (8 characters) and the file size (10 characters). All numeric fields are in decimal, except for the file mode which is in octal. The modification time is the file st_mtime field, i.e., CUT seconds since the epoch. The user and group id's are the file st_uid and st_gid fields. The file mode is the file st_mode field. The file size is the file st_size field. The two-byte trailer is the string "` ". Only the name field has any provision for overflow. If any file name is more than 16 characters in length or contains an embedded space, the string "#1/" followed by the ASCII length of the name is written in the name field. The file size (stored in the archive header) is incre- mented by the length of the name. The name is then written immediately following the archive header. Any unused characters in any of these fields are written as space characters. If any fields are their particular maximum number of charac- ters in length, there will be no separation between the fields. Objects in the archive are always an even number of bytes long; files which are an odd number of bytes long are padded with a newline (`` '') character, although the size in the header does not reflect this. SEE ALSO
ar(1), stat(2) HISTORY
There have been at least four ar formats. The first was denoted by the leading ``magic'' number 0177555 (stored as type int). These ar- chives were almost certainly created on a 16-bit machine, and contain headers made up of five fields. The fields are the object name (8 characters), the file last modification time (type long), the user id (type char), the file mode (type char) and the file size (type unsigned int). Files were padded to an even number of bytes. The second was denoted by the leading ``magic'' number 0177545 (stored as type int). These archives may have been created on either 16 or 32-bit machines, and contain headers made up of six fields. The fields are the object name (14 characters), the file last modification time (type long), the user and group id's (each type char), the file mode (type int), and the file size (type long). Files were padded to an even number of bytes. Both of these historical formats may be read with ar(1). The current archive format (without support for long character names and names with embedded spaces) was introduced in 4.0BSD. The headers were the same as the current format, with the exception that names longer than 16 characters were truncated, and names with embedded spaces (and often trailing spaces) were not supported. It has been extended for these reasons, as described above. This format first appeared in 4.4BSD. COMPATIBILITY
The current a.out archive format is not specified by any standard. ELF systems use the ar format specified by the AT&T System V Release 4 UNIX ABI, with the same headers but different long file name handling. BUGS
The <ar.h> header file, and the ar manual page, do not currently describe the ELF archive format. BSD
June 1, 1994 BSD
All times are GMT -4. The time now is 02:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy