07-13-2009
awk by default consider the "space" as a delimiter.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Could someone please help me with the following.
I'm trying to figure out how to delete two words within a specific file using sed.
The two words are directory and named.
I have tried the following:
sed '//d' sedfile
sed '//d' sedfile
both of these options do not work.....
... (4 Replies)
Discussion started by: klannon
4 Replies
2. UNIX for Advanced & Expert Users
Hi,
Could you please let me know, how to delete first 10 words from text files using vi?
10dw will delete it from current line, how to do it for all the lines from file?
Thanks (6 Replies)
Discussion started by: sentak
6 Replies
3. Shell Programming and Scripting
Hi,
I need help to delete a few words in every line in my file.
This is how the file look like:
VDC DQ 14900098,,,,157426.06849776753,786693.2919373367
10273032,,,,157525.49445429695,776574.5546672409
VDC DG ,10273033,,3er55,,149565.57096061576,801778.9379555212
AS174 892562,,,,,
... (2 Replies)
Discussion started by: andy_s
2 Replies
4. UNIX for Dummies Questions & Answers
I'm hoping someone could help me out please :)
I have several .txt files with several hundred lines in each that look like this:
10241;</td><td>10241</td><td class="b">x2801;</td><td>2801</td><td>TEXT-1</td></tr>
10242;</td><td>10242</td><td... (4 Replies)
Discussion started by: martinsmith
4 Replies
5. UNIX for Dummies Questions & Answers
I have a file with words that begin with character #. Whenver that character is found that word should be deleted throughout the file. How do I do that in VIM.
e.g:
afkajfa ladfa ljafa #222222 kjafad ljl
afajkj kjlj uouu #44444 jlkj lkjl
Output should be
afkajfa ladfa ljafa kjafad... (1 Reply)
Discussion started by: osbourneric
1 Replies
6. Shell Programming and Scripting
Hello,
I have a complex problem. I have a file in which words have been joined together:
Theboy ranslowly
I want to be able to correctly split the words using a lookup file in which all the words occur:
the
boy
ran
slowly
slow
put
child
ly
The lookup file which is meant for look up... (21 Replies)
Discussion started by: gimley
21 Replies
7. Shell Programming and Scripting
This is a Nagios situation.
So i have a list of servers in one file called Servers.txt
And in another file called hostgroups.cfg, i want to remove each and every one of the servers in the Servers.txt file.
The problem is, the script I wrote is having a problem removing the exact servers in... (5 Replies)
Discussion started by: SkySmart
5 Replies
8. Shell Programming and Scripting
Hi all,
I want to make an script using sed that removes everything between 'begin' (including the line that has it) and 'end1' or 'end2', not removing this line.
Let me paste an 2 examples:
anything before
any string begin
few lines of content
end1
anything after
anything before
any... (4 Replies)
Discussion started by: meuser
4 Replies
9. Shell Programming and Scripting
hi, i have a fasta file like this:
>contig00003 length=363 numreads=45 gene=isogroup00001 status=it_thresh
GATTTTTTACCCTGGGAGTGAGGAGGACGAGGTTGAGGATGAAGAAAAGAGAAAGATGAAGAGGTTGAGGATGTT
GTAGTCGGCGGTGGAATTAGGGGGAGCCGGCGAGCCCAAGTATTTTGCAGAGGTGTCTTCATCATCCAAACAACA... (3 Replies)
Discussion started by: the_simpsons
3 Replies
10. UNIX for Dummies Questions & Answers
So;C951;1;2;0;100;true;SNetwork=ORM_RO_MO_R,MeCext=C5951,ManagedElement=1,vsDaFunction=1;473;12;EEE
So;C951;2;2;0;100;true;SNetwork=ORM_RO_MO_R,MeCext=L5921,ManagedElement=1,vsDaFunction=4;481;12;EEE
Output:-
So;C951;1;2;0;100;true;1;473;12;EEE
So;C951;2;2;0;100;true;4;481;12;EEE
Output... (7 Replies)
Discussion started by: pareshkp
7 Replies
LEARN ABOUT OPENSOLARIS
fmlcut
fmlcut(1F) FMLI Commands fmlcut(1F)
NAME
fmlcut - cut out selected fields of each line of a file
SYNOPSIS
fmlcut -clist [filename]...
fmlcut -flist [-dchar] [-s] [filename]...
DESCRIPTION
The fmlcut function cuts out columns from a table or fields from each line in filename; in database parlance, it implements the projection
of a relation. fmlcut can be used as a filter; if filename is not specified or is -, the standard input is read. list specifies the fields
to be selected. Fields can be fixed length (character positions) or variable length (separated by a field delimiter character), depending
on whether -c or -f is specified.
Note: Either the -c or the -f option must be specified.
OPTIONS
list A comma-separated list of integer field numbers (in increasing order), with optional - to indicate ranges. For example: 1,4,7;
1-3,8; -5,10 (short for 1-5,10); or 3- (short for third through last field).
-clist If -c is specified, list specifies character positions (for instance, -c1-72 would pass the first 72 characters of each line).
Note: No space intervenes between -c and list.
-flist If -f is specified, list is a list of fields assumed to be separated in the file by the default delimiter character, TAB, or by
char if the -d option is specified. For example, -f1,7 copies the first and seventh field only. Lines with no delimiter charac-
ters are passed through intact (useful for table subheadings), unless -s is specified. Note: No space intervenes between -f and
list. The following options can be used if you have specified -f.
-dchar If -d is specified, char is the field delimiter. Space or other characters with special meaning to FMLI must be quoted.
Note: No space intervenes between -d and char . The default field delimiter is TAB.
-s Suppresses lines with no delimiter characters. If -s is not specified, lines with no delimiters will be passed through
untouched.
EXAMPLES
Example 1 Getting login IDs and names
The following example gets the login IDs and names.
example% fmlcut -d: -f1,5 /etc/passwd
Example 2 Getting the current login name
The next example gets the current login name.
example% `who am i | fmlcut -f1 -d" "`
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
fmlgrep(1F), attributes(5)
DIAGNOSTICS
fmlcut returns the following exit values:
0 when the selected field is successfully cut out
2 on syntax errors
The following error messages may be displayed on the FMLI message line:
ERROR: line too long
A line has more than 1023 characters or fields, or there is no new-line character.
ERROR: bad list for c/f option
Missing -c or -f option or incorrectly specified list. No error occurs if a line has fewer fields than the list calls for.
ERROR: no fields
The list is empty.
ERROR: no delimiter
Missing char on -d option.
NOTES
fmlcut cannot correctly process lines longer than 1023 characters, or lines with no newline character.
SunOS 5.11 5 Jul 1990 fmlcut(1F)