General :: Command For Appending A Text At The Start Of Every Line And Save It Another File?

Mar 10, 2011

I wish to append a text at the start of every line and save it to another file without changing the original file.know the command

For example:
Orignal.txt
a.txt

[code]...

View 5 Replies


ADVERTISEMENT

General :: Appending To The Current Line In A File Instead Of Creating A New Line?

Apr 1, 2011

I am combining data from a couple different input files and creating an output file in a specific format. I notice that if I use the >> operator, information gets appended to a new line in my output file. This is useful, but if I'd like to append onto the CURRENT line, is there an easy way to do this? I've been googling around and see lots of complicated answers, nothing that suggests to me an easy way to do this. For example, if my output file looks like this:

b1a:] cat test
hello my name is
b1a:]

and I'd simply like to append "Bob", how can I do it? If I use

b1a:] echo Bob >> test
b1a:] cat test
b1a:] hello my name is
Bob
b1a:]

So what I would prefer is some command that would create the result:

hello my name is Bob

View 14 Replies View Related

General :: Convert An HTML Email Saved As A Text File To A PDF File From The Command Line?

Aug 23, 2011

I need to be able to convert HTML email messages saved as text files (.eml or .msg) to PDF documents, one PDF per email, retaining formatting and images.

Are there any Linux tools that will allow me to do this from the command line (so it can be scripted)?

View 1 Replies View Related

General :: Insert Text In The Last Line Of A File With Sed Command?

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

General :: Insert Text To A File Using Command Line?

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

General :: Selecting A Font When Printing A Text File From The Command Line?

Jul 29, 2011

I don't understand why this is so difficult.In the old days, there was lpforms which allowed some formatting. CUPS did not see fit to implement this into it's lp package.cgi-...-cgi?lpforms+1In the old days, lpr allowed you to select a font in the command line with -1=fontname. CUPS did not see fit to implement this into it's lpr package.htmIn the old days, printers had fonts installed on them that you could access. Modern printers don't seem to have this. So now I still need to be able to select a font when I print certain text files from the command line but it seems this is impossible. I've been working with instances and lpoptions, which allows me to do a lot of other things I need like orientation and margins and even set the font size, but I still cannot choose a font other than the default.

View 2 Replies View Related

Debian Multimedia :: Save Image From Clipboard Into File Using Command Line?

Apr 28, 2011

Can save an image from clipboard into file using command line?
may be image magic?

View 3 Replies View Related

General :: Insert A Line Into A Text File Using "sed" Command?

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

General :: Appending Text To Profile In Ubuntu?

Mar 21, 2011

I want to append following text to my profile file from script:

JAVA_HOME="/usr/lib/jvm/java-6-sun"
CATALINA_HOME="/usr/share/tomcat6"
CATALINA_BASE="/var/lib/tomcat6"
ANT_HOME="/usr/share/ant"
export JAVA_HOME CATALINA_HOME CATALINA_BASE ANT_HOME

Kindly let me know how can I accomplish this?

View 2 Replies View Related

Ubuntu :: Error - Failed To Save File ImageMagick Returned Error Code 11 Command Line

May 1, 2010

simple scan error as follows: Failed to save file ImageMagick returned error code 11 Command line: convert -adjoin /tmp/simple-scan-DA9MBV.jpg /tmp/simple-scan-XCK4BV.jpg /tmp/simple-scan-NZVYBV.pdf Stdout: Stderr: using karmic note: I have apparmor extra profiles installed but didn't notice one that related to simple scan or imagemagick. Red herring or not?

View 6 Replies View Related

General :: Save Each Line From Textfile As New File?

Jul 4, 2011

just started with Linux and I'm trying to create new files for each line of my input file. So I have file with 637 lines of data:

2 4 6
2 8 5
3 0 5
etc

and want to create a new file from each line. With

cat name.txt | awk '{ line = $0
print line
}'

I nicely see all lines, but what rests is to save each line separately into new file. I tried While read line command in combination with output >> $.txt, but didn't work well..

View 8 Replies View Related

General :: SQL Like Group By And Sum For Text Files In Command Line?

May 2, 2010

I have huge text files with two fields, the first is a string the second is an integer. The files are sorted by the first field. What I'd like to get in the output is one line per unique string and the sum of the numbers for the identical strings. Some strings appear only once while other appear multiple times. Given the sample data below, for the string glehnia I'd like to get 10+22=32 in the result. how to do this either with gnuwin32 command line tools or in linux shell?

[Code]...

View 2 Replies View Related

General :: Text To ASCII Art Command Line Tool?

Oct 24, 2010

I want a command line tool that echoes a string in ASCII art way, like here.

View 2 Replies View Related

General :: Uploading A Text Into A Webpage From Command Line

Apr 1, 2011

my webpage PHP below. I would like to enter "Hello, in the main inputbox field" below (You are editing: textfile.txt) and click "SAVE" directly from command line.

Sort of : wput_php "hello, in the main inputbox field" click save, and here is it. the text would be uploaded.

PHP Code:

[Code]....

View 2 Replies View Related

General :: Commands To Save Md5sum Of Files In A Folder Into A Text File?

Sep 14, 2010

I've found these commands in [URL]:

Quote:

find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee md5sum.txt

But I don't understand these commands, even after reading their manuals.

View 4 Replies View Related

Ubuntu :: Sort The Output To A Text File So That It Prints To The Text File At 1 Process Per Line?

Feb 6, 2011

im trying to output a list of running processes via a shell script. At the moment i got this which outputs the processes to a text file called out.

echo $(ps aux) >>out

The problem is though, the processes are all just one big block of text which makes it hard to read. Does anyone know how to sort the output to a text file so that it prints to the text file at 1 process per line? I know its probably simple but im very new to linux.

View 5 Replies View Related

General :: Command Line - Print A Group Of Text Matching A Regex?

Sep 22, 2011

I'd like to print only few groups from text matching a regex. How can I do that in the Linux command line?

What other tools for text processing are there in Linux?

View 3 Replies View Related

General :: Command Line Way To View A Line Of A File With Context?

Feb 24, 2011

I'd like show a certain line or lines of a file with context, kind of like a unified diff, on the command line in Linux:

$ (something) -l 154 stuff.py
150: def foo(bar):
151: """

[code]....

View 5 Replies View Related

General :: Start .pps In Command Line?

Jun 16, 2010

i'm using ubuntu with the GUIi have a .pps (power point presentation) on the desktop. I installed the powerpoint viewer and made it the default program for opening the file.when i double click on the file everything works.my problem is i need this on a schedule so i downloaded scheduled task.in scheduled task they ask me the command line i want to execute and that's where it doesn't work. I checked the "allow executing file as program" box on the file but i get the error cannot execute binary file.

View 1 Replies View Related

General :: Cross-platform / Command Line Utilities To Convert PDF / DOC And DOCX To Text

Jul 28, 2011

I am making a text search engine. I need to first convert binary documents to text. I want to go with cross-platform (we develop both on windows and linux) command line (so that I can get the output via python subprocess). What are the choices for this?

View 1 Replies View Related

General :: Start GUI Programs From The Command Line?

Aug 18, 2010

In Windows, if I have a console window open, type winmine, and press enter, Minesweeper will appear, completely separate from the cmd program. The Minesweeper instance is not tied to the command prompt in any way that I know of, with the exception of Minesweeper's parent being set to that instance of the command prompt. It's different in Linux, however.

In Linux, if I have a console window open, type emacs and press enter, Emacs will open, but it seems tied to the command line. Specifically, it appears that I can't use the command line anymore until that instance of Emacs is closed. Is there a way to replicate the Windows behavior in Linux?

View 11 Replies View Related

Ubuntu :: Appending Text To The Output Of Ls?

Jul 14, 2011

I was wondering if it is possible to append some text to the output of ls. Like say, if i wanted to create symbolic links for all the files under a folder in my hard disk to a folder on my desktop, I could say (Pretty sure this won't work, but I am looking forward to something like this) echo ln -s | ls . This should append ln -s to all the files of ls.

View 2 Replies View Related

Programming :: Delete Line Of Text From Text File Via Shell?

Jan 13, 2010

I have to delete a certain line of text from the a textfile via ubuntu's shell scripting.I have done research, and it seems that most people advocate the usage of sed /d option. sed makes does not edit the text file. Hence, most options I discovered involved the use of a temporary variable/textfile and then overwriting the old file with the temporary new file. Is there anyway whereby I can bypass the use of temporary storage containers? I hope there is any magical combination of commands to edit the file directly.

View 3 Replies View Related

General :: Replace Nth Occurence Of String In Each Line Of A Text File?

May 20, 2010

I have large text files with space delimited strings (2-5). The strings can contain "'" or "-". I'd like to replace say the second space with a pipe. What's the best way to go?
Using sed I was thinking of this:

sed -r 's/(^[a-z'-]+ [a-z'-]+) /1|/' filename.txt

View 2 Replies View Related

General :: Splitting Text File Into Several Parts By Line Count

Sep 21, 2009

I have a utility that works with files. The utility is crashing at after about 120 files. The input to the utility is a file containing a filelist. I want to cut the file with the file names in it to seperate files containing about one hundred or so. My thought was to determine the number of lines/100 and then use head and delete to create temporary files to run the utility multiple times to prevent the crash. When I tried to create a variable using the wc -l command the output gives me the number of total lines but it also includes the filename of the input file. (873 Filename.txt) I can not figure out how to remove the Filename.txt from the variable.

View 2 Replies View Related

General :: Start KDE From Command Line (Debian Lenny On IMac)?

Jan 22, 2010

I have a nearly 10 years old iMac at home and installed Lenny on (somehow, I had to thrash Mac OS 9.2 :-P). Everything was successful until now, but on entering "startkde", the screen fills withkpersonalizer: cannot connect to X serverlines. Upon looking at other threads here I tried mdetect, installing X11... but to no avail

View 14 Replies View Related

Programming :: Open Two Text Files - Read Them Line By Line And Update Parameters Of The 3rd File ?

Oct 18, 2010

I have two txt files containing x and y coordinates: xcoord.txt & ycoord.txt. I need to open them; read them line by line to get each coordinate; then each time I need to update Xs and Ys parameters inside another file called "dc.in" with the grabbed values.

Finally each time I need to run two exe files ( dc_2002 and st_vac) and produce corresponding output for each Xs and Ys ( dc.in is an input file for this exe files)

I have written the following code but it does not work:

View 14 Replies View Related

Programming :: Perl - Delete Line From Text File With Duplicate Match At Beginning Of Line

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

Programming :: Add Text Before Line Number In Text File?

May 3, 2010

a sed command to add a text before line number in text file? I have text file with 500 lines, and i want to add 3 more lines with text after line 300, OR before line 302, isn't no problem.

View 16 Replies View Related

Programming :: Bash: Read A Text File Line By Line?

Jul 7, 2011

bash 3.1.17(2) I'm trying do write a shell script which must operate on each line of an ASCII text file. So, all the code must be inside a loop, and inside the loop, the first thing should be to read the next line from the file. I have the bash read command. But it reads from stdin. Any way to make read from a file?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved