Suppose content of my first file:
first line
second line
third line
How can i insert text between "first line" & "second Iline"
Any help?????/ (7 Replies)
Hi,
I wanted to add specific text to each row in a text file containing three rows. Example:
0 8 7 6 5 5
7 8 9 0 7 9
7 8 9 0 1 2
And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this:
21 0 8 7 6 5 5
7 8... (4 Replies)
I need to add "new lines" of text with special characters, to specific lines in the file. There are 3 modifications needed. Been testing 2 here without success.
#!/usr/bin/perl
use FileHandle;
$file=FileHandle->new;
$FILENAME="/opt/etc/usr/file.txt";
$file->open ("<$FILENAME") or die... (13 Replies)
this is Korn shell unix.
The scenario is I have a pipe delimited text file which needs to be customized. say for example,I have a pipe delimited text file with 15 columns(| delimited) and 200 rows. currently the 11th and 12th column has null values for all the records(there are other null columns... (4 Replies)
I have a space delimited text file with two columns. I would like to add NA to the first column of the text file.
Input:
19625 10.4791768259
19700 10.8146489183
19701 10.9084026759
19702 10.9861346978
19703 10.9304364984
Output:
NA19625 10.4791768259
NA19700 10.8146489183... (1 Reply)
I would like to use grep to select multiple lines from a text file using a single-column text file. Basically I want to only select lines from the first text file where the second column of the first text file matches the second text file. How do I go about doing that? Thanks! (5 Replies)
Hi,
I want to add a text to the end of the specific line in a file. Now my file looks like this:
999
111
222
333
111
444
I want to add the string " 555" to the end of the first line contaning 111. Moreover, I want to insert a newline after this line containg the "000" string. The... (8 Replies)
hello,
I try to add users from a text file with this form:
username:groupename:homedir
first i extract data which is separated by ":"
then i use useradd to add users/groups.
but,,, my code doesn't works :
#!/bin/bash
echo "give me a text file: "
read dir
# control if... (2 Replies)
This is an extract from a large file. The lines that start with fc are ports on a fabric switch. In between each fc port there is information about the port.
fc2/12 is up
Port description is SEIEDISCOVER-3
Speed is 4 Gbps
fc2/13 is down (Administratively down)
fc2/14 is up
Port... (1 Reply)
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
LEARN ABOUT DEBIAN
net::domain::tld
Net::Domain::TLD(3pm) User Contributed Perl Documentation Net::Domain::TLD(3pm)NAME
Net::Domain::TLD - Work with TLD names
SYNOPSIS
use Net::Domain::TLD qw(tlds tld_exists);
my @ccTLDs = tlds('cc');
print "TLD ok
" if tld_exists('ac','cc');
DESCRIPTION
The purpose of this module is to provide user with current list of
available top level domain names including new ICANN additions and ccTLDs
Currently TLD definitions have been acquired from the following sources:
http://www.icann.org/tlds/
http://www.dnso.org/constituency/gtld/gtld.html
http://www.iana.org/cctld/cctld-whois.htm
PUBLIC METHODS
Each public function/method is described here.
These are how you should interact with this module.
"tlds"
This routine returns the tlds requested.
my @all_tlds = tlds; #array of tlds
my $all_tlds = tlds; #hashref of tlds and their descriptions
my @cc_tlds = tlds('cc'); #array of just 'cc' type tlds
my $cc_tlds = tlds('cc'); #hashref of just 'cc' type tlds and their descriptions
Valid types are:
cc - country code domains
gtld_open - generic domains that anyone can register
gtld_restricted - generic restricted registration domains
new_open - recently added generic domains
new_restricted - new restricted registration domains
"tld_exists"
This routine returns true if the given domain exists and false otherwise.
die "no such domain" unless tld_exists($tld); #call without tld type
die "no such domain" unless tld_exists($tld, 'new_open'); #call with tld type
COPYRIGHT
Copyright (c) 2003-2005 Alex Pavlovic, all rights reserved. This program
is free software; you can redistribute it and/or modify it under the same terms
as Perl itself.
AUTHORS
Alexander Pavlovic <alex.pavlovic@taskforce-1.com>
Ricardo SIGNES <rjbs@cpan.org>
perl v5.10.1 2011-04-18 Net::Domain::TLD(3pm)