[Long] Program to do massive text operation

C

Chaos Master

Hello people.

I have a file coming from an UNIX-like system (FreeBSD) - a series of "taglines"
which has this format:

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
foo foo foo bar bar foo bar bar foo bar bar foo bar bar foo bar bar blah blah
blah blah.
%
foo bar foo bar foo bar foo.
%
foooooooooooooooooooooo barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
tkagiohaohjoahjiha

(The examples are broken with newlines, as they're with newlines when they come
from FreeBSD system).

For a Windows application I need to remove the line breaks and the %.
It will turn into:

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
foo foo foo bar bar foo bar bar foo bar bar foo bar bar foo bar bar blah blah
blah blah.
foo bar foo bar foo bar foo.
foooooooooooooooooooooo barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
tkagiohaohjoahjiha

(those examples are not to wrap lines. This is intentional. Sorry.)

Under Linux I have the "awk" program which helps me doing that.
Is there any program for Windows to do this massive removal of newline chars
from a file?

Thanks, and sorry for the long post
 
D

dkg_ctc

Hello people.

I have a file coming from an UNIX-like system (FreeBSD) - a series
of "taglines" which has this format:

blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah foo foo foo bar bar foo bar bar foo bar bar foo bar
bar foo bar bar blah blah blah blah.
%
foo bar foo bar foo bar foo.
%
foooooooooooooooooooooo
barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
tkagiohaohjoahjiha

(The examples are broken with newlines, as they're with newlines
when they come from FreeBSD system).

For a Windows application I need to remove the line breaks and the
%. It will turn into:

blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah foo foo foo bar bar foo bar bar foo bar bar foo bar
bar foo bar bar blah blah blah blah.
foo bar foo bar foo bar foo.
foooooooooooooooooooooo
barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
tkagiohaohjoahjiha

(those examples are not to wrap lines. This is intentional.
Sorry.)

Under Linux I have the "awk" program which helps me doing that.
Is there any program for Windows to do this massive removal of
newline chars from a file?

Thanks, and sorry for the long post

There's a gawk (GNU awk) for Windows, if you'd like to use it.

http://gnuwin32.sourceforge.net/packages/gawk.htm

There's also sed for Windows, which may work, although I'll admit that
my knowledge of *nix'ish command-line tools is fairly limited.

http://gnuwin32.sourceforge.net/packages/sed.htm
 
R

REM

Chaos Master <[email protected]> wrote:
Hello people.
I have a file coming from an UNIX-like system (FreeBSD) - a series of "taglines"
which has this format:
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
foo foo foo bar bar foo bar bar foo bar bar foo bar bar foo bar bar blah blah
blah blah.
%
foo bar foo bar foo bar foo.
%
foooooooooooooooooooooo barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
tkagiohaohjoahjiha
(The examples are broken with newlines, as they're with newlines when they come
from FreeBSD system).
For a Windows application I need to remove the line breaks and the %.
It will turn into:

ReplaceEm (was BK ReplaceEm)

http://www.boolean.ca/replace/bkrep20.exe
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
foo foo foo bar bar foo bar bar foo bar bar foo bar bar foo bar bar blah blah
blah blah.
foo bar foo bar foo bar foo.
foooooooooooooooooooooo barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
tkagiohaohjoahjiha
 
R

rir3760

It was a dark and stormy night when Chaos Master
I have a file coming from an UNIX-like system (FreeBSD) - a series
of "taglines" which has this format:

blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah foo foo foo bar bar foo bar bar foo bar bar foo bar
bar foo bar bar blah blah blah blah.
%
foo bar foo bar foo bar foo.
%
foooooooooooooooooooooo
barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
tkagiohaohjoahjiha

(The examples are broken with newlines, as they're with newlines
when they come from FreeBSD system).

For a Windows application I need to remove the line breaks and the
%. It will turn into:

blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah foo foo foo bar bar foo bar bar foo bar bar foo bar
bar foo bar bar blah blah blah blah.
foo bar foo bar foo bar foo.
foooooooooooooooooooooo
barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
tkagiohaohjoahjiha

(those examples are not to wrap lines. This is intentional.
Sorry.)

Under Linux I have the "awk" program which helps me doing that.
Is there any program for Windows to do this massive removal of
newline chars from a file?

If you know how to use awk/sed/etc then try Cygwin, a unix like
package for win32:
<http://www.cygwin.com/>

Regards
 
C

Chaos Master

There should be a part of dkg_ctc brain within this message' contents:

There's a gawk (GNU awk) for Windows, if you'd like to use it.

http://gnuwin32.sourceforge.net/packages/gawk.htm

There's also sed for Windows, which may work, although I'll admit that
my knowledge of *nix'ish command-line tools is fairly limited.

http://gnuwin32.sourceforge.net/packages/sed.htm

On a *nix system, I actually would use awk or write a "quick hack" in any
programming language. I will try it.

[]s
--
© 2004 Chaos Master | "I'm going under,
Posting from Brazil! | drowning in you
Linux User #349031 : | I'm falling forever,
Slackware / Knoppix | I've got to break through"
---------------------. -- Evanescence, "Going Under"
 
C

Chaos Master

There should be a part of REM brain within this message' contents:


This worked 100%. Thank you!
--
© 2004 Chaos Master | "I'm going under,
Posting from Brazil! | drowning in you
Linux User #349031 : | I'm falling forever,
Slackware / Knoppix | I've got to break through"
---------------------. -- Evanescence, "Going Under"
 
J

J44xm

["Chaos Master"; Sat, 05 Jun 2004 03:47:45 GMT]
Thanks, and sorry for the long post

I'm concerned about a generation when 38 lines is considered that long.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top