LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 03-18-2006, 11:40 AM   #1
Schreiberling
Member
 
Registered: Jan 2006
Location: Bremen, Germany
Distribution: Suse Linux 9.3, 10.0, 10.2
Posts: 34

Rep: Reputation: 15
Converting lots of text files to Unicode


That's not the first time I have expressed all relevant information about my question in the title. Therefore, I'm finishing here in awaitness for your answers.
 
Old 03-18-2006, 11:51 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,610
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
Check out iconv

See reply title.
 
Old 03-19-2006, 07:45 AM   #3
Schreiberling
Member
 
Registered: Jan 2006
Location: Bremen, Germany
Distribution: Suse Linux 9.3, 10.0, 10.2
Posts: 34

Original Poster
Rep: Reputation: 15
Gui

I'm sorry for overhastily posing that question, mostly my questions are such specific that I can't find a suitable solution. I have reviewed the similar threads, unfortunately there was no GUI program mentioned. Is there a program that is capable of converting for example ISO-8859-1 to UTF-8? Just like as in OpenOffice with your .doc files.
Thanx.
 
Old 03-19-2006, 08:55 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,610
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
unfortunately there was no GUI program mentioned
You didn't mention the necessity of a GUI.


Is there a program that is capable of converting for example ISO-8859-1 to UTF-8?
iconv!


Oh, well. Here's an example of a lame GUI for iconv.
It depends on default shell, iconv and a package called "zenity" which supercedes Xdialog.
Save as "iconv_gui" somewhere in your path (say /usr/local/bin), chown as necessary, chmod 0750, and run.
Files (copy) are saved to dir "TMP/iconv_out".
YMMV(VM).
Code:
#!/bin/sh
# iconv_gui for www.linuxquestions.org 20060319
if [ -z "${TMP}" -o  ! -d "${TMP}" -o ! -w "${TMP}" ]; then exit 127; fi
if [ -d "${TMP}" -a ! -d "${TMP}/iconv_out" ]; then mkdir "${TMP}/iconv_out"; fi
convList=($(iconv --list | tr -d ",\/\/"|egrep -v "(^(The.f|not.n|the.F|listed.w)|[[:blank:]])"))
if [ -x "${#convList[@]}" ]; then exit 1; fi
convFrom=$(zenity --width=400 --title="Iconv-GUI: select \"From\" charset:" --list --column=" ${convList[@]}" --separator=" " 2>/dev/null)
if [ -x "${convFrom}" ]; then exit 1; fi
convTo=$(zenity --width=400 --title="Iconv-GUI: select \"to\" charset:" --list --column=" ${convList[@]}" --separator=" " 2>/dev/null)
if [ -x "${convTo}" ]; then exit 1; fi
zenity --width=600 --title="Iconv-GUI: select files:" --file-selection --multiple --separator="\n" | while read l; do
if [ -f "${l}" ]; then convOut="${TMP}/iconv_out/$(basename "${l}")"; if [ ! -f "${convOut}" ]; then 
iconv -f ${convFrom} -t ${convTo} "${l}" > "${convOut}"; fi; fi; done; exit 0
 
Old 07-13-2007, 03:01 PM   #5
mauran
LQ Newbie
 
Registered: Dec 2005
Location: Sri Lanka
Distribution: unbuntu 7.04
Posts: 17

Rep: Reputation: 0
see this thread

http://www.linuxquestions.org/questi...d.php?t=568708
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DOS text files to UNIX text files ta0kira Linux - Software 7 03-15-2011 11:42 AM
converting Windows text to Linux text joshknape Linux - Software 3 09-11-2005 12:52 PM
How do I enter Unicode text in X11? uman Linux - Software 0 12-07-2004 10:14 PM
Networking&Text files; A string or two, and LOTS of int's quentusrex Programming 9 10-27-2004 05:19 AM
grep on Unicode files overbored Linux - Software 2 07-18-2004 01:12 PM


All times are GMT -5. The time now is 06:38 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration