General :: Recognized Pragma - Insert At The Beginning Of A Text Document To Designate It To Be UTF-8 Encoded
Jun 4, 2011
Is there some kind of universally recognized pragma that one can insert at the beginning of a text document to designate it to be UTF-8 encoded (or any other encoding)? I've seen certain editors insert encoding comments, and one or two compilers that have an encoding pragma. But I was wondering if anyone has tried to establish some kind of universal tag format for text documents.
View 1 Replies
ADVERTISEMENT
Aug 5, 2010
I am trying to create a shell script where a user can specify a file with a list of logins and the script will create a batch file with specific information in specific columns.
Example:
loginfile.txt has
User1
User2
User3
I need the output to be as below:
1 User1 Date 12/31/9999
2 User2 Date 12/31/9999
3 User3 Date 12/31/9999
Where the columns are separated as below.
1[tab][tab]User1[tab]date +%D[tab]12/31/9999
2[tab][tab]User2[tab]date +%D[tab]12/31/9999
3[tab][tab]User3[tab]date +%D[tab]12/31/9999
I can use the nl utility to get the numbers easily enough, but I need two tab separations between the number and the user list. Is there a sed command that will insert at the beginning of each line? If so I can just run nl after I get some tabs up in the front.
View 2 Replies
View Related
Feb 28, 2011
I have a lot a folders, each named by a number, and in each of these folders I have a specific file (stddev.dat) containing a single line (of numbers) I need to have a single file with each line being one of the stddev.dat (no matter if it is sorted or not), and also I need to add at the begining of each line the number of the folder it comes from.
I 'm no bash expert, and the "add at the begining of the line" is a bit of problem to me". Here is what I've come up with so far, just to put everything in one file, (and also if you know a better/more elegant way to do the same thing I've done, I'm listening)
[Code]...
View 6 Replies
View Related
Jun 1, 2010
Can I use sed to include a text file in the beginning of other text files inside a folder and its subfolders? So it should be recursive.
View 4 Replies
View Related
Jan 19, 2009
I need to insert 3-4 lines of text to the beginning of a text file. The file is a largish MYSQL dump, the result of a backup shell script. This shell script should insert the required text.I've wrestled with sed, but lost.
View 2 Replies
View Related
Aug 23, 2009
Code:
sed -n '123p' file
that will print line 123 but how might I insert text to a specified line?
View 3 Replies
View Related
Aug 11, 2010
I need a lightweight GUI text editor on my Ubuntu Lucid system which lets me specify a Unicode code point (e.g. U+1234), and inserts that character to a UTF-8 text document. I know that gedit can't do it (not even with the Character Map plugin).
I'm not interested in solutions involving any kind of emacs or vi. I'm also not interested in text editors running in the terminal (such as joe, which has this functionality). I need the absolute simplest, smallest and fastest plain text editor for Linux which lets me type a few letters, insert a few characters by their code, type some more letters, and then save the .txt file as UTF-8-encoded.
View 1 Replies
View Related
Oct 4, 2010
I want to insert the text "DB dept" in the last line of passwd file which looks like this right now
Quote:
newuser:x:717:717::/home/sacharje:/bin/bash
And I want it to be like this:
Quote:
newuser:x:717:717: DB dept:/home/sacharje:/bin/bash
I tried to do that with sed but failed, I'd like to know the proper syntex with sed to achieve this.
View 7 Replies
View Related
Jan 28, 2010
I need to be able to edit a file from the commend line as I intend to script this operation, the file is called menu.lst The original is as below
Code:
titleUbuntu 8.04.3 LTS, kernel 2.6.24-24-generic
root(hd0,0)
kernel/boot/vmlinuz-2.6.24-24-generic root=UUID=b09feb23-5524-4ec4-862f-94700b968f64 ro quiet splash
[code]....
View 4 Replies
View Related
Dec 7, 2010
When I try to open text file with mouse pad or kate write all I see is PK and in small letters HF over TF_. I have no idea how this happened. How do I get my text document back? Using XFCE4.6.1, mousepad and kate write for my journal. Properties says its a zip archive but I didn't do that. Anyway tried to unzip it and got:
Code:
PowerJustice may be a plain executable, not an archive
unzip: cannot find zipfile directory in one of PowerJustice or
PowerJustice.zip, and cannot find PowerJustice.ZIP, period.
View 6 Replies
View Related
Mar 9, 2010
know what can be done to enable the "select text to copy" and "shift+insert to paste" features in linux.
View 2 Replies
View Related
Feb 27, 2011
I would like to create a command in the vim that saves a text document and also compile it. Is it possible?
View 4 Replies
View Related
Mar 28, 2010
How to copy text from vmware from linux text terminal in to word document in windows?
View 14 Replies
View Related
Jan 14, 2010
I am trying to append text to the beginning of a file. This is what I have so far.
Code:
date_default_timezone_set('America/Chicago');
$date=date("m-d-Y g:i:s a");
[code]....
View 7 Replies
View Related
Sep 18, 2010
I've been reading tutorials of Linux sed command, but haven't got anything yet. the problem is : I want to insert a line into my DNS database file which has a pattern like below:
<Domain name> 3tabs here <IN> <A> <ip address>
the question is : how to add a line into a file like this using linux sed command? I have problem inserting tabs and the spaces!
View 7 Replies
View Related
Oct 4, 2010
I'm coming to emacs from Xcode. An Xcode feature I really like is the ability to type the lines#pragma mark -#pragma mark Section Heading Nameto mark the subsequent part of my code as belonging to a particular section. I can then jump to that section from a drop-down menu.Does a similar ability to break up code into named sections and to jump to a section by name exist in emacs?
View 2 Replies
View Related
Apr 8, 2011
i need to add this line nameserver 208.67.122.221 from ISP before the first nameserver already exists in resolv.conf in all workstations i know
Code:
sed '/nameserver/ i
ameserver 208.67.122.221'
but that insert it on every line after nameserver not only before the first one
Code:
# blah blah
# blah blah
domain mydom.com
[code]....
View 3 Replies
View Related
Dec 13, 2010
i trying to add text messge in textarea and i got error in connection and i don't know if it correct syntax. and i wonder when i was install xamp server it no password required. but i dont know what password that i input in my php connection.?
PHP Code:
<?php
$con = mysql_connection("localhost","root","123");
if(!$con)
{
[code]....
PHP Code:
<textarea rows="3" cols="30" name="txtcomment" wrap="physical">Leave a Comment
View 4 Replies
View Related
Jun 29, 2010
I have a file like so:
Code:
one
two
three
four
I would like to insert prior to the word "three" all items from this second file with the following contents:
Code:
four
three
two
one
Now my issue is, and I have been using both sed and awk currently, that after the second line of the new file is read there will of course now be 2 copies of the word "three" but I would like to only insert the final 2 words, ie "two" and "one" prior to only the first occurrence of the word "three" so final file will look like:
Code:
one
two
four
[code]....
So here there is now only one of each word from the second file joined to make the new file. For simple code I have tried something like the following:
Code:
while read line
do
awk -v n=$line '!f && /three/{print n;f++}1' file1 > tmp_file
mv tmp_file file1
done < file2
Now this works but seems very clumsy to me. There is obviously a better sed and / or awk out there.
View 5 Replies
View Related
Mar 11, 2010
if you execute :
#!/bin/bash
echo "some textstring" >> logfile.txt
then the string "some textstring " will be APPENDED to logfile.txt Is there a redirect way that in stead of appended, the string will be INSERTED at the top of the logfile.txt file ? If this cannot be done by redirecting, what would be the best way to insert the test-string at the top of the logfile ?
View 2 Replies
View Related
Aug 29, 2010
Using Debian Lenny
OpenOffice 2.4
I'm trying to fill in an application form that I downloaded. It has some shaded areas where I can answer questions, but there are
a couple places where the shaded areas are missing.Have you previously applied with the C.B.E? "Readonly content cannot be changed No modifications will be accepted." Can I add a shaded area in so I can fill this in, or can I disable the read only part?
View 9 Replies
View Related
Mar 19, 2011
I want to be able to preform functions on the PDF such as enlarge font and copy & paste. I'm using Gnome, but will download packages and dependencies for any desktop environment.
View 3 Replies
View Related
Jun 15, 2011
I have a URL that I'm trying to redirect back to the homepage on my site. For some reason since it contains hex I can't seem to get it to work.
A sample source URL is:
[url]
The destination URL is:
[url]
I've tried many different things to no avail.
Some things include:
Redirecting source URLs with REG_LOGINfromURL will get me what I need. Some of my examples work when the source URL does not contain enconded characters, so if the URL was instead [url] it would redirect.
I'm running RHEL 4 and Apache/2.0.52.
View 2 Replies
View Related
Apr 1, 2009
Was wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):
There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.
If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.
View 7 Replies
View Related
Oct 16, 2010
As indicated in the subject, I want to search a text. If the text is present I want to replace it. But if the text is not present, I want to insert it after first line and before last line.
Searched text is:CleanCache "*";
Where * can be anything.
Example: CleanCache "false"; -> CleanCache "true";
If CleanCache "false"; is not present, only insert CleanCache "true"; after first line and before last line.
View 8 Replies
View Related
Nov 23, 2010
I have an old scanner script that uses pamthreshold to create a small greyscale image of a text document. This program does not seem to be available in debian. Can anyone tell me how I can install it, or if there are any better alternatives available?
View 1 Replies
View Related
Jul 17, 2011
The "fg", "bg" and "jobs" commands all exist in slackware, and their definition of what a job is, is not simply "any old app that happens to be running", because they all tell me that there are no jobs running on my system.
So how can I get them to recognize a particular app as a "job"?
View 3 Replies
View Related
Oct 21, 2010
Recently I connected second monitor to my laptop. Everything seems ok. I got what i wanted: extended working space, panel on second monitor with windows list that are present on corresponding screen. One thing that is annoying me is GDM. It displays login dialog on my second LCD not laptop. Is there a way to make GDM to display login dialog window on my laptop or how to designate laptop LCD as primary screen or something?
View 3 Replies
View Related
Jan 1, 2010
I know the #pragma pack(2); but how to use #pragma comment ,#pragma message , #pragma XXX .... etc..even only one example would be OK, well, let's assume the compiler is GCC, alright ? for that GCC is my favorite compiler, for a very little time i gonna use VC.
View 6 Replies
View Related
Jul 25, 2011
On windows I really only used Notepad++ as my text editor, it had two features that I loved.What I need to accomplish is what I would do with Notepad++ column editor.I could have like 100 lines, and place the cursor at a column, and goto edit>column editor, and I could insert an incrementing number. (I could also pad the incrementing number with 0s, this was GREAT for making batch files among other things.)So each line at that column had a number higher than the previous line.The other feature that I used sometimes was a search/replace with regex patterns.Does anyone know of an editor that has those features for linux? I am mostly after the column editor insert feature but if you know of one with both features that would rock.
View 1 Replies
View Related