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 the Servers.txt file.
The hostgroups.cfg file often contains servernames with similar matching names and getting sed to remove JUST the server in the $EACH variable is another problem i keep encountering.
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)
Hi,
I have the following codes below that aims to delete every words between two pattern word. Say I have the files
To delete every word between WISH_LIST=" and " I used the below codes (but its not working):
#!/bin/sh
sed '
/WISH_LIST=\"/ {
N
/\n.*\"/ {... (3 Replies)
lets see if i can explain this in a good way.
im trying to replace some words in a file but i need to know what the words are that is beeing replaced. not sure if sed can do this.
file.name.something.1DATA01.something.whatever
sed "s/./.DATA?????/g"
need to know what the first . is... (2 Replies)
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)
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)
Hi All,
I have an input file a.txt which contains the following ::
08-08-09 1:00 PM 763763762 f00_unix1_server.txt
i Just need to delete all the words which is before f
Output ::
f00_unix1_server.txt
Thanks (4 Replies)
I have an input text that looks like this (comes already sorted):
on Caturday 22 at 10:15, some event
on Caturday 22 at 10:15, some other event
on Caturday 22 at 21:30, even more events
on Funday 23 at 11:00, yet another event
I need to delete all the matching words between the lines, from... (2 Replies)
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)
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)
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
LEARN ABOUT REDHAT
unix2dos
unix2dos(1) General Commands Manual unix2dos(1)NAME
unix2dos - UNIX to DOS text file format converter
SYNOPSYS
unix2dos [options] [-c convmode] [-o file ...] [-n infile outfile ...]
Options:
[-hkqV] [--help] [--keepdate] [--quiet] [--version]
DESCRIPTION
This manual page documents unix2dos, the program that converts text files in UNIX format to DOS format.
OPTIONS
The following options are available:
-h --help
Print online help.
-k --keepdate
Keep the date stamp of output file same as input file.
-q --quiet
Quiet mode. Suppress all warning and messages.
-V --version
Prints version information.
-c --convmode convmode
Sets conversion mode. Simulates unix2dos under SunOS.
-o --oldfile file ...
Old file mode. Convert the file and write output to it. The program default to run in this mode. Wildcard names may be used.
-n --newfile infile outfile ...
New file mode. Convert the infile and write output to outfile. File names must be given in pairs and wildcard names should NOT be
used or you WILL lost your files.
EXAMPLES
Get input from stdin and write output to stdout.
unix2dos
Convert and replace a.txt. Convert and replace b.txt.
unix2dos a.txt b.txt
unix2dos -o a.txt b.txt
Convert and replace a.txt in ASCII conversion mode. Convert and replace b.txt in ISO conversion mode.
unix2dos a.txt -c iso b.txt
unix2dos -c ascii a.txt -c iso b.txt
Convert and replace a.txt while keeping original date stamp.
unix2dos -k a.txt
unix2dos -k -o a.txt
Convert a.txt and write to e.txt.
unix2dos -n a.txt e.txt
Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt.
unix2dos -k -n a.txt e.txt
Convert and replace a.txt. Convert b.txt and write to e.txt.
unix2dos a.txt -n b.txt e.txt
unix2dos -o a.txt -n b.txt e.txt
Convert c.txt and write to e.txt. Convert and replace a.txt. Convert and replace b.txt. Convert d.txt and write to f.txt.
unix2dos -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt
DIAGNOSTICS BUGS
The program does not work properly under MSDOS in stdio processing mode. If you know why is that so, please tell me.
AUTHOR
Benjamin Lin - ( blin@socs.uts.edu.au )
MISCELLANY
Tested environment:
Linux 1.2.0 with GNU C 2.5.8
SunOS 4.1.3 with GNU C 2.6.3
MS-DOS 6.20 with Borland C++ 4.02
Suggestions and bug reports are welcome.
SEE ALSO dos2unix(1)1995.03.31 unix2dos v2.2 unix2dos(1)