A Windows 98 & ME forum. Win98banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Win98banter forum » Windows 98 » General
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

looking for utility to convert text files from Mac (& Unix) in abatch process



 
 
Thread Tools Display Modes
  #1  
Old May 6th 11, 04:47 AM posted to microsoft.public.win98.gen_discussion
SlickRCBD[_3_]
External Usenet User
 
Posts: 104
Default looking for utility to convert text files from Mac (& Unix) in abatch process

I'm looking for something similar to this program called "flip" that
will convert the "newline" character in text files, only one that will
allow me to use wildcards to convert a bunch of text files in a batch
process.

I've spent time searching, and found a bunch of Linux commands to do
it, but I'm not using Linux.

Could somebody point me to a utility that can do the job? It shouldn't
be too hard, I used to have a program called "ASCII Helper" on my old
Apple IIGS that could do this, why can't I find anything for Windows?
  #2  
Old May 6th 11, 10:22 AM posted to microsoft.public.win98.gen_discussion
philo[_34_]
external usenet poster
 
Posts: 56
Default looking for utility to convert text files from Mac (& Unix) ina batch process

On 05/05/2011 10:47 PM, SlickRCBD wrote:
I'm looking for something similar to this program called "flip" that
will convert the "newline" character in text files, only one that will
allow me to use wildcards to convert a bunch of text files in a batch
process.

I've spent time searching, and found a bunch of Linux commands to do
it, but I'm not using Linux.

Could somebody point me to a utility that can do the job? It shouldn't
be too hard, I used to have a program called "ASCII Helper" on my old
Apple IIGS that could do this, why can't I find anything for Windows?




http://www.cyberciti.biz/faq/unix-co...s-for-windows/
  #3  
Old May 6th 11, 01:20 PM posted to microsoft.public.win98.gen_discussion
Lostgallifreyan
external usenet poster
 
Posts: 1,562
Default looking for utility to convert text files from Mac (& Unix) in a batch process

SlickRCBD wrote in news:b8647c9e-5615-47be-b761-
:

I'm looking for something similar to this program called "flip" that
will convert the "newline" character in text files, only one that will
allow me to use wildcards to convert a bunch of text files in a batch
process.

I've spent time searching, and found a bunch of Linux commands to do
it, but I'm not using Linux.

Could somebody point me to a utility that can do the job? It shouldn't
be too hard, I used to have a program called "ASCII Helper" on my old
Apple IIGS that could do this, why can't I find anything for Windows?


Lua. Tiny scripting language. If you get into that you can build your own
tools. It's cross-platform between all major platforms too. OSX, Windows,
BSD, Linux...)

If you're interested, here's a few common functions for quick starting:

function OpenTest(F)
F=io.open(F) if F then return F:close() end
end

function DataLoad(F)
F=assert(io.open(F,"rb")) local D=F:read("*a")
F:close() return D
end

function DataSave(F,D)
F=assert(io.open(F,"wb")) F:write(D) F:close()
end

function TextLine(S,T) --String, Table.
S=string.gsub(S,"\r\n?","\n")
if (string.sub(S,-1)~="\n") then S=S.."\n" end
for X in string.gfind(S,"(.-)\n") do table.insert(T,X) end
return T
end

function TextFile(T,N) --Table, Newline.
return table.concat(T,N)..N
end

Paths to files use forward slashes like URL's and non-Windows OS's.
FileTest() tets for a file existing, able to be opened. Data functions load
and save all files, as binary. So if you want to handle text as lines, do
TextLine(DataLoad()), and save using DataSave(TextFile()). If you go deep you
can do other things like appaend, but this method saves a LOT of hassle most
times.

One nice thing about Lua is the the entire manual can be (and is) written on
a single page of HTML. It's worth the effort. Instead of wondering where to
get something that CAN do, you'll usually be wondering what ths CAN'T do, and
as Lua itself is smaller than most dedicated single-purpose tools, that's
amazing.
  #4  
Old May 6th 11, 01:28 PM posted to microsoft.public.win98.gen_discussion
Lostgallifreyan
external usenet poster
 
Posts: 1,562
Default looking for utility to convert text files from Mac (& Unix) in a batch process

Btw, Lua, like UNIX, is case sensitive throughout. It's character matching
and replace methods are second to none, except perhaps Perl's (which I never
learned because Lua is much easier to read and write), so wildcarding
filenames and converting substrings is easy.

I use this to convert Mac newlines to Windows newlines in emails so they work
properly (email needs windows types, hex 0D 0A, both linefeed AND carriage
return, which makes sense if you think about it..)

X=string.gsub(X,"(.)\n",function(S) if S=="\r" then S="" else Y=Y+1 end
return S.."\r\n" end)

(Beware wordwrap).
More correctly, that function might better be built once, outside the
string.sub function, and called repeatedly from inside, if you're using this
on really big tasks, but it works ok for a 12MB text file as it is so I let
it pass.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dos commands for text files [email protected] General 3 August 30th 06 11:37 AM
Map Unix rob p Networking 6 April 29th 06 09:27 PM
.crwl files and how do I stop the process that creates them mgm General 2 April 29th 06 12:18 PM
text files Steve2ae General 3 December 17th 05 08:58 PM
There is no viewer capable of viewing Text Document files. Raymond General 5 June 24th 04 05:12 PM


All times are GMT +1. The time now is 06:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Win98banter.
The comments are property of their posters.