General :: Change File Character Set?
Aug 9, 2010I would like to know how I can change a file so it has the same character encoding as files saved as comma separated csv files from Microsoft Excel.
I have tried using iconv to do this. code...
I would like to know how I can change a file so it has the same character encoding as files saved as comma separated csv files from Microsoft Excel.
I have tried using iconv to do this. code...
I have a script that looks like:
Code:
cat servers.txt
trivia:P:N
trivia:D:N
tucana:P:Y
[code]....
I want to be able to find the lines that matches my input and change the N to a Y, but only for the lines that matches the name and not any other N's My problem is the line does not always contain a P as it can be a D as well so my matching did not work. If my script issues the name $1=triva the lines will change to:
Code:
trivia:P:Y
trivia:D:Y
I have the following code so far but as you can see it does not change the D's
Code:
sed -i 's/trivia:P:Y/trivia:P:N/g' servers.txt
*** UPDATE ***
should I be using a method as follows? I am still stuck on the changing all instances though.
Code:
$1=server
sed -i 's/$server1:P:Y/$server:P:N/g' server.txt
sed -i 's/$server1:D:Y/$server:D:N/g' server.txt
1.What character instructd the shell to interpret a special character as an ordinary character?
2.What directory contains some of the utilities available on the system in the form of binary files?
3. What command is used to search the location of a utility?
4. What command is used to instruct the editor to write the file and quit the editor?
5. What key quits the more utility and displays the shell prompt?
6. What command starts a child shell as the super user, taking on root's identity and environment?
7. Which wildcard characters can be used for searching all the files in the system that start with "A"?
8. The user name or login name of the super user is????
[Code]....
I am trying to copy a large number of files from a Linux server to a Windows file share. Unfortunately, all of the files and folders I have to copy have 10 numbers followed by 2 colons "::" in the name (example: 1234567890::WordDoc.doc) which of course is invalid in windows naming conventions. So now I'm trying to come up with a way to change the file and folder names on the fly to replace the colons with a dash "-" or space " ". I'm even willing delete the frist 12 characters in necessary. I have tried cp, mv, tr, and several -bash scripts but get no positive results.
View 4 Replies View RelatedI have got certain files which somehow contain abnormal character "Del" "0x7f" or 177 which represents Del. And this is causing SVN to reject these files and abruptly end the process. I need to remove those characters from the file names but am not able to. find or grep do not search the files. This is how the file looks like with ls or find code...
View 3 Replies View RelatedIs there a known tool to convert a file consisting of 2 byte Hex into ascii?
Note: - Maintain file offset listing in bytes code...
I have a csv file that has around 3 million rows. I want to process this file so that it creates a new file that contains only the rows that have 2 characters or less in the first column column.At the moment i am using SQL Loader but its taking too long so im wondering whether this would be easier if done in Unix?
View 8 Replies View RelatedMy distribution is CentOS 5.5, I installed Oracle 11g and create an instance setting its character set as AL32UTF8. The problem is the message from oracle cannot be shown correctly,
Like this:
ORA-00942: ?
I guess that maybe the characterset of my CentOS differs from what oracle uses.
So i turned to /etc/sysconfig/i18n and found:
LANG="zh_CN.UTF-8"
So i changed contents of i18n to:
LANG="zh_CN.AL32UTF8"
But still cannot solve the problem. Maybe my linux don't know what AL32UTF8 is?
I am experiencing some difficulties accessing some of my drives which have folders/files whose names include special characters. That problem has appeared just now, in Fedora 11, and just in XFCE4 (it somehow got stuck with the English default). In neither GNOME nor KDE happens.
The problem is not narrowed down to Thunar because even the terminal fails to recognize the special characters in XFCE4.
I guess that is simply solved by editing some configuration file, but I can't seem to find it.
What do I need to do to allow XFCE4 recognize special characters?
EDIT: It's definitely XFCE4, because if I open Thunar or xterm from GNOME, they recognize special-characters-filenames very well.
I have two machines in a local network and want to share files among them. Since I don't want to bother configuring NFS right now I am using ssh and scp to transfer files among them. There is a little problem though: the machines have different *nixes. One machine has Fedora 12 (Spanish) and the other one has PCBSD 7.1.1 (English).The problem is that both machines have different character encoding and while the Fedora machine can perfectly handle names with special characters, the BSD machine can't and in fact upon doing ssh to the Fedora machine filenames (with special characters) appear wrong and prove difficult to work with.
View 2 Replies View RelatedHow can I change the third level of the 1 (one) key to umlauted a using German Dvorak layout?
View 1 Replies View RelatedIn Vim, I can change the text up until the next instance of "X" using this command:
Code:
cfX
The problem is that it includes "X". What if I want to change until, but not including, "X"?
Part of a perl script I am writing need to change the character at an index to upper case. Now i am new to perl and i am having some trouble getting it to do it. In c++ i would do something like
Code:
Now from what i understand the same thing is possible in perl using regular expressions. But i cant get it to work.
What config file do you change to change default run level???
View 3 Replies View RelatedI want to split file foo into two parts, and I only intersted in the first one. But the N bytes in which the first part consists, I want it to be an exact replica of the corresponding bytes of foo. More exactly:
Code:
foo foo1 foo2
==============================
90 90 05
[code]....
I want to grep a a file for each '#' character that starts a line, the thing is the file is utf-8 and it starts with some some characters 'ef bb bf' is there a way to have grep to work with utf-8 files ?
[Code]....
Im trying to read a file in c++ and search for particular character for example if this is a list that I have:
Alice
Bob
David
[code]....
if the input is D, it should give David, if its B, gives bob. so in this case, meaning it reads the first character of every line. but if possible I want to make this dynamic so the user can specify which character position he is looking for, so in case he is looking for R as character index 3 in all lines, it should give Charlie. but the problem is, it does now recognize , besides, I do not know how to specify the character position in each line.
here is my code
Code:
#include <iostream>
#include <fstream>
#include <cstring>
[code]....
I need some software that will check .xml file and tell me which character is malformed in 'utf-8'. I am using perl for some parsing.
View 2 Replies View RelatedI have an ntfs partition that I wish to access as a normal user(non-root). For this I did the following. As root I created a folder /windows and did a chmod 777 -R on /windows. Then I added the following line to /etc/fstab
Code:
/dev/sda3 /windows ntfs-3g defaults,nosuid,nodev,umask=000 1 0
Now, the partition is mounted alright but the problem is that when any other user (non-root) creates a files in /windows (say by executing touch newfile) the newly created file has the owner and group set as root. The non-root user can create the file and he can also delete the file, however, he cannot change the permissions of the file and also the owner:group is always set as root:root. How do I get across this problem, i.e. how do I mount a partition, so that a non-root user can also change the permissions and ownerships of the files he creates.
This is for educational purpose. In fact it is my lab tutorial for a subject.I want to capture the users password when he changes his password. Both new and old.This is the script i have come up with:
Code:
#!/bin/bash
echo "Changing password for user $USER."
[code]...
In my command prompt I did:
Code:
sed 's/://' mytextfile > newtextfile
But it only deleted the first instance of : in each line when some lines have multiple : appearing in each one. How can I delete all the : from the entire file?
Is there a way to process individual characters one-by-one from a text file in Bash, or is that hoping for a little too much from this lovable old clunker?
View 13 Replies View Relatedi want to substitute in a file what it comes with "(" character to "('". i have tried to do it with gsub but it doesn`t go well with regular expression.
View 4 Replies View RelatedI need to write a shell script which can compare two files(text files) character wise. eg. underscore is space.
------FILE 1---------------
A_B_C
D_E_F
G_H_I
[code].....
Actual problem: I need to write a shell script which can give me difference character by character not by line (using comm)
I was messing around with the alternate character panel app and made a custom character set. I then wanted to put it on a new panel and created a new panel. I moved the character set to that panel, and then started to mess around with the panel settings (auto hide, show hide buttons, and expand, to be specific.) So far so good, until I moved the panel from the right side of the screen to the top. I already had a panel here, and it seemed not to like hiding a panel when there was already one on the top.
When the new panel hid itself, all my panels stopped responding (any clicks on them did nothing) and my processor started going at 100%. I tried a reboot and the only thing that changed is that now I can't even see my panels. I'm guessing I need to change the settings back manually through the prompt, but I don't know how to do that. I am using 10.04 and have not upgraded gnome since upgrading to 10.04.
I want to use SED to do the following: In a text file replace any occurrences of the three character string ZZZ with a quotation mark "and. replace all occurrences of a comma with a semi-colon. It is the S/ / / command which is stumping me on the first issue...inparticular how to get the replace string to be quote.
View 9 Replies View Relatedwhere to get the character set that includes this character "〪" and the install instructions (if any) Needed font file name is ARIALUNI.TTF owned by MS
View 3 Replies View RelatedI have a textfile with name negin.txt in /home and did the following:
Right click → Properties → Permissions → Advanced Permissions → Add Entry → Named User user:wwwrun
Is it possible to do this over the shell?
I tried chown wwwrun /home/negin.txt but got no result. What is wrong here?
There seems to be a limit of 2 gb on files. Im trying to add my music files and have about 7 gb. Is there a way to make a file that will allow the extra info.
View 7 Replies View RelatedWe can use inotify related tools (fam, etc.) to know "when" a file change occurs, but, Can I know where (file position, offset) this change was made? For example, suppose that you have a big file and you are monitoring changes on it, using inotify-tools package or something like that you can take acknowledged if another process chage that file, but How can I know "where" that change was maded in order to avoid read all file content looking for a change maded?
View 5 Replies View Related