tools to seperate one large text file into two small text files?

tools to seperate one large text file into two small text files?

Post by Yong Zhan » Tue, 12 Nov 2002 23:52:25



Hi,

How to seperate one large text file into two small text files in Solaris? I
have a log file too big to open, and I only need the last small part of it.

Thanks!

Yong

 
 
 

tools to seperate one large text file into two small text files?

Post by Rev. Don Koo » Tue, 12 Nov 2002 23:59:48



> Hi,

> How to seperate one large text file into two small text files in Solaris? I
> have a log file too big to open, and I only need the last small part of it.

        Use "tail".

Quote:> Thanks!

        No problem.

                Hope this helps,
                        Don

--
***************************      You a bounty hunter?
* Rev. Don McDonald, SCSA *      Man's gotta earn a living.
* Baltimore, MD           *      Dying ain't much of a living, boy.
***************************      "Outlaw Josey Wales"

 
 
 

tools to seperate one large text file into two small text files?

Post by Jimm » Wed, 13 Nov 2002 03:23:44



> How to seperate one large text file into two small text files in Solaris?
I
> have a log file too big to open, and I only need the last small part of

it.

The 'split' command can do this but if you only need the last small part
of a text file you may be better off using 'tail'.

-Jimmo

 
 
 

tools to seperate one large text file into two small text files?

Post by Dave Marquard » Thu, 14 Nov 2002 00:01:32



Yong> How to seperate one large text file into two small text files in
Yong> Solaris? I have a log file too big to open, and I only need the
Yong> last small part of it.

Try tail, or perhaps split.
--
Dave Marquardt
Sun Microsystems, Inc.
Austin, TX
+1 512 401-1077

 
 
 

tools to seperate one large text file into two small text files?

Post by Yong Hua » Fri, 15 Nov 2002 06:02:26



> Hi,

> How to seperate one large text file into two small text files in Solaris? I
> have a log file too big to open, and I only need the last small part of it.

I have some tips about handling large text files. Look at Section 2
"How to read a large file" at
http://www.stormloader.com/yonghuang/computer/logfile.html

Yong Huang

 
 
 

1. Sed: Replace text in one file with SPECIFIC text from another

Hi all,
  I'm trying to take a dhcpd.conf file and replace each IP address in
it with a host name. The address-to-hostname map is in hosts. This is
what I've got so far:

sed -e '/\([0-9]\{1,3\}[.]\)\{3\}[0-9]\{1,3\}/R hosts' dhcpd.conf

So far, this appends a single line from hosts to the matched line in
dhcpd.conf, here is sample output:

        fixed-address         192.168.1.81;
192.168.1.92    term012

The first line is from dhcpd.conf and the second is from hosts.
However, I have not been able to figure out how to append the
appropriate line; at the moment, it's going in sequence through hosts
and the lines being appended do not match the IP.

I've tried to get the output of grep piped into the read file, a la:

sed -e '/\([0-9]\{1,3\}[.]\)\{3\}[0-9]\{1,3\}/R `grep \1 hosts`'
dhcpd.conf

But it does nothing. I've tried several variants to no avail.

1) So the first task is to get the proper lines appended to the proper
places.

2) The second task is to modify the new data to have only the host
name.
To the best of my knowledge, reading does not affect the pattern space.
Is it possible to accomplish this in one pass if the pattern space is
not affected? Will I have to write the output to a new file and then
sed it again to get the results I want?

Any and all help is appreciated.

TIA,
Al

2. Less_Tif

3. MS-window text file viewer to read a text file in SCO server.

4. Disk Space.

5. Dos Text Files to Linux Text Files

6. when will the netfilter conntrack helper will be called?

7. Extracting lines from a text file that match a certain criteria to another text file

8. SuSE plans 2003 Linux desktop push

9. conver dos text file to unix text file

10. how to split a very huge text file into small files

11. need to split large text file into two, via every-other line

12. insert text from one file into another (multiple files)

13. Sweep several files into one text file?