I am trying to parse out each string within the () for each line.
I tried, as example:
But for some reason, the output gets all garbled after the the first fields.
Guess I can try the following but it is very messy, as I would have to do that for each Descriptor before the first (.
The number of fields can change dynamically..
Another example:
So the desired output woul be:
Quote:
BOS.FOS.T.CDG.MEDGTOC.01 CLENTT1 NOTFIXED) YES Cargo dangerous goods queue CLCRGT1 BOS.FOS.T.CDG.MEDGTOC.01
CLFOST1 CLENTT1 NOTFIXED YES Qmgr Alias for CLFOST1 Cluster
RPT.PSS.T.VILS.ODY.01 CLENTT1 YES PSS MSGS TO VILS ODYSSEY CLITAT1 RPT.PSS.T.VILS.ODY.01
I have data that looks like this
aaa!bbb!ccc/ddd/eee
It is not fixed format. I need to parse ddd into a var in order to decide if I want to process that row. If I do I need to put ccc and bbb into vars to process it. I need to do this during a while loop one record at a time. Any... (11 Replies)
Is there a betterway to cut certain columns in everyline based on positions.
Basically, I have a largefile and eachline is of 1000 characters and I need to cut the characters 17-30, 750-775, 776-779, 780-805
while
do
fptr=`cat $tempfile | head -$i | tail -1`
... (4 Replies)
I have a file with the following format
12g data/datasets/cct 8g data/dataset/cct
10 g data/two 5g data/something_different
10g something_different
5g data/two
is there a way to loop through this... (1 Reply)
Hi,
I'm using awk in HP-UX machine which does not support systime(), strftime(). So to get the date time I was using :
seq 1 100000 | awk ' "date +%Y%m%d%H%M%s" | getline curtime; print curtime }'
However the above code gets the date only once, next time it is not updated. For... (2 Replies)
Hello All,
I am new to shell scripting and programming. I am looking for a guide on how I can parse specific information from a plain text file with thousands of lines. Specifically I need to parse an email address from each line. The line looks something like this:... (9 Replies)
Good afternoon!
I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Hello,
I want to add a letter to the end of a string if it repeats in a column.
so if I have a file like this:
DOG001
DOG0023
DOG004
DOG001
DOG0023
DOG001
the output should look like this:
DOG001-a
DOG0023-a
DOG004
DOG001-b (15 Replies)
I am executing df -mP to see the disk utilization.
I would like to append servername also to each and every line.
df -mP | awk '{ print $1","$2","$3","$4","$5","$6 }'
trying to add something like this
df -mP | awk '{ print $1","$2","$3","$4","$5","$6","$hostname }' ... (1 Reply)
All,
I have a sample text like below.
Key (Header)
Key1
ABC
Key2
ABC
Key3
ABC
ABC
Key4
ABC
Key5
ABC
ABC
ABC
Required Output
Key (Header)
Key1 (2 Replies)
Another project, another bump in the road and another chance to learn. I've been trying to open gzipped files and parse data from them and hit a snag. I have data in gzips with a place followed by an ip or ip range sort of like this:
Some place:x.x.x.x-x.x.x.x
I was able to modify some code... (6 Replies)
Discussion started by: Azrael
6 Replies
LEARN ABOUT SUSE
repeat
textutil::repeat(n) Text and string utilities, macro processing textutil::repeat(n)
__________________________________________________________________________________________________________________________________________________NAME
textutil::repeat - Procedures to repeat strings.
SYNOPSIS
package require Tcl 8.2
package require textutil::repeat ?0.7?
::textutil::repeat::strRepeat text num
::textutil::repeat::blank num
_________________________________________________________________DESCRIPTION
The package textutil::repeat provides commands to generate long strings by repeating a shorter string many times.
The complete set of procedures is described below.
::textutil::repeat::strRepeat text num
This command returns a string containing the text repeated num times. The repetitions are joined without characters between them. A
value of num <= 0 causes the command to return an empty string.
Note: If the Tcl core the package is loaded in provides the command string repeat then this command will be implemented in its
terms, for maximum possible speed. Otherwise a fast implementation in Tcl will be used.
::textutil::repeat::blank num
A convenience command. Returns a string of num spaces.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category textutil
of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
SEE ALSO
regexp(n), split(n), string(n)
KEYWORDS
blanks, repetition, string
textutil 0.7.1 textutil::repeat(n)