Solved

ascii to unicode text file conversion

Posted on 1998-07-31
1
479 Views
Last Modified: 2013-12-26
Hi, I am looking for a utility to convert text files from ascii to unicode. I have tried the native2ascii (-reverse) util that comes with JDK but it doesn't cut it. I want to process directories of files at a time, that util does 1 at a time. I wrote a small program to run this util for every file in a dir but it runs way too slow and it then screws up my files.

If there isn't a decent util like that around, i'll pay many more points for a nice perl
script or C file (if you write it in C-> i'm using linux kernel 2.0.35 in slackware with libc5). I could do this in Java but won't bother if someone gives me a perl or C file.

Thanks in advance
-Rasp (rshortt@quantumtraining.nb.ca)
0
Comment
Question by:rasp
1 Comment
 

Accepted Solution

by:
ijduggan earned 50 total points
ID: 1295322
You can try using the find program. Go to the base of the file tree and type this to make native versions of the files with extension .ntv. This is c shell code and assumes the files all have extension .asc.

for file (`find . -name '*.asc' -print`)
native2ascii -reverse $file `echo $file | sed 's/.asc/.ntv/'`
end

Or in perl:

#!/usr/athena/bin/perl

@files = split(/\n/, `find . -name '*.sh'`);

for (@files) {
    $outfile = $_;
    $outfile =~ s/(.*)\.asc$/$1\.ntv/;
    system("native2ascii -reverse $_ $outfile");
}


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 48
How do you programatically show and hide the Windows 10 On-Screen-Keyboard? 3 530
ffmpeg - "rtsp://...... Operation not permitted" 4 74
no14 challenge 14 62
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now