Sponsored Content
Full Discussion: sed/awk String problem
Top Forums UNIX for Dummies Questions & Answers sed/awk String problem Post 20480 by odogbolu98 on Friday 26th of April 2002 06:38:10 PM
Old 04-26-2002
Question sed/awk String problem

I would appreciate it if any one can guide me in using awk perhaps sed in extracting some values from a long string.

here is an example.
.......some lines here........
........ aaaa bbbb cccc ddddd eeeee fffff gggg (time:hhhh)........
......some lines here also..........

How can I extract bbbb, eeee, hhhh from multiple lines in a single transaction? the position of these values varies

Smilie odogbolu98
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed problem - replacement string should be same length as matching string.

Hi guys, I hope you can help me with my problem. I have a text file that contains lines like this: 78 ANGELO -809.05 79 ANGELO2 -5,000.06 I need to find all occurences of amounts that are negative and replace them with x's 78 ANGELO xxxxxxx 79... (4 Replies)
Discussion started by: amangeles
4 Replies

2. Shell Programming and Scripting

Problem to add the string(without sed & awk) into the middle of file

Hi, I have tried many times to add the string into the first line of the file or the middle of the file but could not find the solution. I first tried by $echo "paki" >> file This code only append paki string at the end of file "file" but how can i add this "paki" into the first line or... (5 Replies)
Discussion started by: ali hussain
5 Replies

3. Shell Programming and Scripting

A problem for sed? Remove parts of a string

Hi, My knowledge about sed is limited but I have a problem that I think can be solved with sed. I have a variable in a shell script that stores a lot of path/filenames and the delimitter between them is a space (they all exist on the same line). One part of the filename is the file creation... (4 Replies)
Discussion started by: pcrs
4 Replies

4. Shell Programming and Scripting

Problem with sed string substitution

Hi, heres my problem: echo "aaaa(aaaa(aaa" | sed 's/a.*(//g' gives aaa but it should give aaaa(aaa .*( should find any string to the appearance of (, but it finds any string to the last appearance, any idea why, and how to do this? and what if the string ist... (2 Replies)
Discussion started by: funksen
2 Replies

5. Shell Programming and Scripting

problem with sed while replacing a string with another

Hi, I have a line something like this sys,systematic,system I want to replace only the word system with HI I used sed for this as below echo sys,systematic,system | sed 's/system/HI/' but I got output as sys,HIatic,system I wanted output as sys,systematic,HI Please tell me... (9 Replies)
Discussion started by: friendyboy
9 Replies

6. Shell Programming and Scripting

Sed and white spaced string problem

Consider a string with white space "abc 123" string="abc 123" echo $string abc 123 sed "s/$string/$string 456/" file abc 123 456 cat file abc 123 OK for now, but if you put this one in a shell script it gives the result: abc 456 123 somehow string end in first white space ?? ... (3 Replies)
Discussion started by: xramm
3 Replies

7. Shell Programming and Scripting

problem using sed to match a string

Hi There! I'm stuck with a problem trying to output some sections of a rss feed to my conky program using curl and sed. The rss feed is for tide times and I wish to output the times but not the rest to the conky desktop. To do this I need to pull out the four instances of times that are in... (4 Replies)
Discussion started by: huffpuff
4 Replies

8. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

9. Shell Programming and Scripting

Replace string in XML file with awk/sed with string from another

Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file: </member> <member> <name>TransactionID</name> <value><string>123456789123456</string></value> </member> <member> <name>Number</name> ... (9 Replies)
Discussion started by: cozzin
9 Replies

10. Shell Programming and Scripting

Replace string of a file with a string of another file for matches using grep,sed,awk

I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: --> cat comp.pkglist Package list: nss-util-devel-3.28.4-1.el6_9.x86_64 Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
sccsfile(4)							   File Formats 						       sccsfile(4)

NAME
sccsfile - format of an SCCS history file DESCRIPTION
An SCCS file is an ASCII file consisting of six logical parts: checksum Character count used for error detection. delta table Log containing version info and statistics about each delta. usernames Login names and/or group IDs of users who may add deltas. flags Definitions of internal keywords. comments Arbitrary descriptive information about the file. body the Actual text lines intermixed with control lines. Each section is described in detail below. Conventions Throughout an SCCS file there are lines which begin with the ASCII SOH (start of heading) character (octal 001). This character is here- after referred to as the control character, and will be represented as `^A'. If a line described below is not depicted as beginning with the control character, it cannot do so and still be within SCCS file format. Entries of the form ddddd represent a five digit string (a number between 00000 and 99999). Checksum The checksum is the first line of an SCCS file. The form of the line is: ^A hddddd The value of the checksum is the sum of all characters, except those contained in the first line. The ^Ah provides a magic number of (octal) 064001. Delta Table The delta table consists of a variable number of entries of the form: ^As inserted/deleted/unchanged ^Ad type sid yr/mo/da hr:mi:se username serial-number predecessor-sn ^Ai include-list ^Ax exclude-list ^Ag ignored-list ^Am mr-number ... ^Ac comments ... ... ^Ae The first line (^As) contains the number of lines inserted/deleted/unchanged respectively. The second line (^Ad) contains the type of the delta (normal: D and removed: R), the SCCS ID of the delta, the date and time of creation of the delta, the user-name corresponding to the real user ID at the time the delta was created, and the serial numbers of the delta and its predecessor, respectively. The ^Ai, ^Ax, and ^Ag lines contain the serial numbers of deltas included, excluded, and ignored, respectively. These lines do not always appear. The ^Am lines (optional) each contain one MR number associated with the delta. The ^Ac lines contain comments associated with the delta. The ^Ae line ends the delta table entry. User Names The list of user-names and/or numerical group IDs of users who may add deltas to the file, separated by NEWLINE characters. The lines con- taining these login names and/or numerical group IDs are surrounded by the bracketing lines ^Au and ^AU. An empty list allows anyone to make a delta. Flags Flags are keywords that are used internally (see sccs-admin(1) for more information on their use). Each flag line takes the form: ^Af flag optional text The following flags are defined in order of appearance: ^Af t type-of-program Defines the replacement for the %T% ID keyword. ^Af v program-name Controls prompting for MR numbers in addition to comments. If the optional text is present, it defines an MR number validity checking program. ^Af i Indicates that the `No id keywords' message is to generate an error that terminates the SCCS command. Otherwise, the message is treated as a warning only. ^Af b Indicates that the -b option may be used with the SCCS get command to create a branch in the delta tree. ^Af m module-name Defines the first choice for the replacement text of the %M% ID keyword. ^Af f floor Defines the "floor" release, that is, the release below which no deltas may be added. ^Af c ceiling Defines the "ceiling" release, that is, the release above which no deltas may be added. ^Af d default-sid The d flag defines the default SID to be used when none is specified on an SCCS get command. ^Af n The n flag enables the SCCS delta command to insert a "null" delta (a delta that applies no changes) in those releases that are skipped when a delta is made in a new release (for example, when delta 5.1 is made after delta 2.7, releases 3 and 4 are skipped). ^Af j Enables the SCCS get command to allow concurrent edits of the same base SID. ^Af l lock-releases Defines a list of releases that are locked against editing. ^Af q user-defined Defines the replacement for the %Q% ID keyword. ^Af e 0|1 The e flag indicates whether a source file is encoded or not. A 1 indicates that the file is encoded. Source files need to be encoded when they contain control characters, or when they do not end with a NEWLINE. The e flag allows files that contain binary data to be checked in. Comments Arbitrary text surrounded by the bracketing lines ^At and ^AT. The comments section typically will contain a description of the file's pur- pose. Body The body consists of text lines and control lines. Text lines do not begin with the control character, control lines do. There are three kinds of control lines: insert, delete, and end, represented by: ^AI ddddd ^AD ddddd ^AE ddddd respectively. The digit string is the serial number corresponding to the delta for the control line. SEE ALSO
sccs-admin(1), sccs-cdc(1), sccs-comb(1), sccs-delta(1), sccs-get(1), sccs-help(1), sccs-prs(1), sccs-prt(1), sccs-rmdel(1), sccs-sact(1), sccs-sccsdiff(1), sccs-unget(1), sccs-val(1), sccs(1), what(1) SunOS 5.10 30 Sep 2002 sccsfile(4)
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy