11-12-2008
How to replicated records using sed
I need to generate exactly 102 duplicates in a file using sed.
Here's an example of my input:
Grid-ref = 1, 148
Grid-ref = 1, 311
Grid-ref = 1, 428
I need:
Grid-ref = 1, 148
Grid-ref = 1, 148
Grid-ref = 1, 148
Grid-ref = 1, 148
... repeated 102 times, then
Grid-ref = 1, 311
Grid-ref = 1, 311
Grid-ref = 1, 311
... repeated 102 times, then record 3, etc.
Any ideas using either sed (preferably), awk or ksh?
thanks
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi gurus, hoping someone can help with a sed line that can do the following...
I have a flat file with about 1000 records, but in order to import into openoffice spreadsheet, I need to create a delimited file. I'd like to do 2 things with the SED command:
1- add a pipe character "|" at the end... (4 Replies)
Discussion started by: RogCor
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I want to use the sed command to delete some lines in a file and I was wondering whether there is a possibility of knowing which lines are deleted, or at least which line numbers.
Thanks (4 Replies)
Discussion started by: vanagreg
4 Replies
3. Shell Programming and Scripting
Hi all,
First off, Thank you all for the knowledge I have gleaned from this site!
Deleting Records from a text file... sed paragraphs
The following code works nearly perfect, however each time it is run on the log file it adds a newline at the head of the file, run it 5 times, it'll have 5... (1 Reply)
Discussion started by: Festus Hagen
1 Replies
4. Shell Programming and Scripting
Hi for all!
sorry guys for my dumb question, but I'm really need help
so,
we have file with many many fields, like this one:
201001002359 blablabla 87654321 201001002359 123,56 77272588300 blablabla/123 91823778544and I wrote awk command
awk '{if($6~/(2588300|2580000|2587021)$/)print}'so,... (8 Replies)
Discussion started by: shizik
8 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I am looking for a simple concise solution most likely using sed to process the following 4 rows of data from the same record and only keeps it if the second record satisfy certain critea such as surname matches up to smith or jackson:
John (firstname)
Smith (surname) ... (21 Replies)
Discussion started by: gjackson123
21 Replies
6. Shell Programming and Scripting
I have input file like
AAA
AAA
CCC
CCC
CCC
EEE
EEE
EEE
EEE
FFF
FFF
GGG
GGG
i was trying to retrieve data between two strings using sed.
sed -n /CCC/,/FFF/p input_file
Am getting output like
CCC
CCC
CCC (1 Reply)
Discussion started by: NareshN
1 Replies
7. Shell Programming and Scripting
ok. i have an extensive program written predominantly in borne shell. i have to give an "evaluation" copy of this program to a user so she can test it out and see if she wants it. problem is, i dont have an evaluation copy. and even if i did, im worried the evaluation copy can be edited to... (8 Replies)
Discussion started by: SkySmart
8 Replies
8. Solaris
Hi everybody
We have a Sun Cluster with two nodes, connected to a number of SAN disks over fiber cables. We made SVM disk sets on those disks for our application needs.
Now we constructed another site in another metropolitan area, but with only one node (no cluster), and connected it to the main... (2 Replies)
Discussion started by: abohmeed
2 Replies
9. Shell Programming and Scripting
Please assist with the following.
I have readings R1, R2,..Rn from plants from different fields , sometimes replicated. I need to first consolidate the replicates by their mean value per plant per field. Then I need to reformat the data by partially transposing it.
The missing values... (3 Replies)
Discussion started by: jianp83
3 Replies
QRDEL(1) Sun Grid Engine User Commands QRDEL(1)
NAME
qrdel - delete Sun Grid Engine Advance Reservations (AR)
SYNTAX
qrdel [-f] [-help [-u wc_user_list] wc_ar_list
DESCRIPTION
Qrdel provides a means for a user/operator/manager to delete one or more Advance Reservations (AR). A manager/operator can delete ARs
belonging to any user, while a regular user can only delete his or her own ARs. If a manager wants to delete another user's AR, the man-
ager can specify the AR id. By default, "qrdel wc_ar_name" will delete only the ARs belonging to that user. A manager is able to delete
another user's AR via "-u wc_user_list". Jobs referring to an AR tagged for deletion will also be removed. Only if all jobs referring to
an AR are removed from the Sun Grid Engine database will the AR also be removed.
Qrdel deletes ARs in the order in which the AR identifiers are presented. Find additional information concerning wc_user_list and
wc_ar_list in sge_types(1).
OPTIONS
-f Force action for AR. The AR and the jobs using the AR are deleted from the Sun Grid Engine queuing system even if the sge_execd(8)
controlling the AR jobs does not respond to the delete request sent by the sge_qmaster(8).
Users which have neither Sun Grid Engine manager nor operator status can only use the -f option for their own ARs.
-help Prints a list of all options.
-u wc_user_list
Deletes only those ARs which were submitted by users specified in the list of usernames. For managers, it is possible to use qrdel
-u "*" to delete all ARs for all users. If a manager wants to delete a specific AR for a user, he has to specify the user and the AR
id. If no AR is specified, all ARs belonging to that user are deleted.
wc_ar_list
A list of AR id's that should be deleted
ENVIRONMENTAL VARIABLES
SGE_ROOT Specifies the location of the Sun Grid Engine standard configuration files.
SGE_CELL If set, specifies the default Sun Grid Engine cell. To address a Sun Grid Engine cell qrdel uses (in the order of prece-
dence):
The name of the cell specified in the environment variable SGE_CELL, if it is set.
The name of the default cell, i.e. default.
SGE_DEBUG_LEVEL
If set, specifies that debug information should be written to stderr. In addition the level of detail in which debug infor-
mation is generated is defined.
SGE_QMASTER_PORT
If set, specifies the tcp port on which the sge_qmaster(8) is expected to listen for communication requests. Most installa-
tions will use a service map entry for the service "sge_qmaster" instead of defining the port.
FILES
<sge_root>/<cell>/common/act_qmaster
Sun Grid Engine master host file
SEE ALSO
sge_intro(1), qrstat(1), qrsub(1), qsub(1), sge_qmaster(8), sge_execd(8).
COPYRIGHT
See sge_intro(1) for a full statement of rights and permissions.
SGE 6.2u5 $Date$ QRDEL(1)