03-28-2009
sed selective data parsing
i have file in the following format
*RECORD*
*FIELD NO*
123456
*FIELD TX*
this is a sample entry
*FIELD SA*
See Also
*FIELD RF*
References
*FIELD CS*
Clinical Symptoms
*FIELD AV*
Allelic Variants
*FIELD EH*
Edit History
*RECORD*
*FIELD NO*
123456
*FIELD TX*
this is a sample entry
*FIELD RF*
There is no "SA" field, just References
*FIELD CS*
Clinical Symptoms. There are no allelic variants (AV) field
*FIELD EH*
Edit History
1) How to parse this data using SED?
2) Extract field, if available
Any input if available
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have a file in the foll. format
*RECORD*
*FIELD NO*
.......
.......
*FIELD TX*
Data
*FIELD AV*
Data
*FIELD RF*
*RECORD*
*FIELD NO*
.......
.......
*FIELD TX*
Data
*FIELD RF* (4 Replies)
Discussion started by: dunstonrocks
4 Replies
2. Shell Programming and Scripting
Hi,
I would like to seek for methods to do selective extraction of line froma file. The scenario as follows:
I have a file with content:
message a
received on 11:10:00
file size: 10 bytes
send by abc
message b
received on 11:20:00
file size: 10 bytes
send by abc (3 Replies)
Discussion started by: dwgi32
3 Replies
3. Shell Programming and Scripting
Hi,
I have the following text which I want to search and replace using perl and sed. I would appreciate any help.
Please notice the file contains schema name with a single dot and a double dot . &&WEBDIR_SCHEMA. and &&WEBDIR_SCHEMA .. }
I would like to change it to the acutal schema... (5 Replies)
Discussion started by: jville
5 Replies
4. Shell Programming and Scripting
Hi,
I have an xml file having serveral smiliar lines as below
<INPUT VAR1 ="" DATATYPE ="number(p,s)" VAR2 ="" VAR3 ="3" VAR4="0" VAR5 ="ELEMITEM" VAR6 ="NO" VAR7 ="NOT A KEY" VAR8 ="17" LEVEL ="0" NAME ="UNIX" NULLABLE ="NOTNULL" OCCURS ="0" OFFSET ="19" PHYSICALLENGTH ="15"... (3 Replies)
Discussion started by: dips_ag
3 Replies
5. Shell Programming and Scripting
Good day all.
I have the following entries of data in a file in a column, however, I need this data written on a single line with several parameters in a different order.
Current format:
Treatment
,parmeter1=value
,parmeter2=value
,parmeter3=value
,parmeter4=value... (7 Replies)
Discussion started by: BRH
7 Replies
6. Shell Programming and Scripting
Hi
I am having a code snippet
grant permission to all user
sts|ln|uSe|PSG
sajncht|se|Use|PPSPSG
psg|ln|use|TSPSG
sts_user.Me revoke
I need to change all occurance of use (uSe,Use,use) with USE. I am using the following sed command for this
sed 's//USE/g' s_sample.txt
Output: (7 Replies)
Discussion started by: sudeep.id
7 Replies
7. Shell Programming and Scripting
Hi,
This is a vcd file.A vcd file may have 'n' modules.
1) I need to capture the data in bold,i.e. the module names (shown in bold)
2) Also i need to capture the data inside each individual module,say for tst_bench_top ,i need to capture data from line 4 to line 20 ...
I just want one... (2 Replies)
Discussion started by: veerabahu
2 Replies
8. Shell Programming and Scripting
Experts ,
Below is the data:
--- Physical volumes ---
PV Name /dev/dsk/c1t2d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 8
PE Size (Mbytes) 8
Total PE 4350
Free PE 2036
Allocated PE 2314
Stale PE 0
IO Timeout (Seconds) default
--- Physical volumes ---... (5 Replies)
Discussion started by: rveri
5 Replies
9. Shell Programming and Scripting
Hi folks
I have a script I wrote that basically parses a bunch of config and xml files works out were to add in the new content then spits out the data into a new file.
It all works - apart from the xml and config file format in the new file
with XML files the original XML (that ends up in... (2 Replies)
Discussion started by: dfinch
2 Replies
10. Shell Programming and Scripting
I have the following file which at times can be quite large so can be difficult to read, I need a script that just extracts particular delimited data and outputs to alternate file
$cat fix1.log
FIX4.4|0=12|55=LIT.L|48=123456|32=5|52=20111107-10:52:22.128|38=100|10=200|
... (6 Replies)
Discussion started by: Buddyluv
6 Replies
LEARN ABOUT NETBSD
set_field_pad
FORMS(3) BSD Library Functions Manual FORMS(3)
NAME
field_back, field_fore, field_pad, set_field_back, set_field_fore, set_field_pad -- form library
LIBRARY
Curses Form Library (libform, -lform)
SYNOPSIS
#include <form.h>
chtype
field_back(FIELD *field);
chtype
field_fore(FIELD *field);
int
field_pad(FIELD *field);
int
set_field_back(FIELD *field, chtype attribute);
int
set_field_fore(FIELD *field, chtype attribute);
int
set_field_pad(FIELD *field, int pad);
DESCRIPTION
Calling the function field_back() will return the character attributes that will be applied to a field that is not the current field, these
attributes can be set by the set_field_back() function. The field_fore() function returns the character attributes that will be used to
indicate that a field is the currently active one on the form, this attribute may be set by using the set_field_fore() function. The pad
character for a field is the character that will be printed in all field locations not occupied with actual field contents. The pad charac-
ter can be retrieved by calling the field_pad() function, the pad character is set by using the set_field_pad() function.
RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following
error values:
E_OK The function was successful.
SEE ALSO
curses(3), forms(3)
NOTES
The header <form.h> automatically includes both <curses.h> and <eti.h>.
BSD
January 1, 2001 BSD