Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Add strings from one file at the end of specific lines in text file Post 302867695 by gus74 on Thursday 24th of October 2013 05:26:14 PM
Old 10-24-2013
Wow, that was incredibly fast and it works like a charm. Thank you so much! The real Yoda you certainly are.

And another answer! Thank you Bartus!

Both solutions do exactly what I was looking for, thanks a ton!

edit: I'll take this as motivation to learn this language, I had no idea it was so powerful.
 

10 More Discussions You Might Find Interesting

1. Programming

Delete specific lines in a text file

Hi, experts, I would like to create a function that can calculate the total number of lines in a saved text file and delete specific lines in that particular file (I only want the last few lines). Hav anybody have the experience and giv me a hand in this? (9 Replies)
Discussion started by: dniz
9 Replies

2. HP-UX

Add a column at the end of all the lines in a file

Hi Guys, :D I am very much new to UNIX. I dont have much basics of coding in UNIX, so please help me out of thi ssituation. I have a file say for ex: ABC.dtd and it contains "|" delimited data as test1|testing|test3|moving past1|runing|test4|going I need to add a column at the end... (6 Replies)
Discussion started by: ruthless
6 Replies

3. Shell Programming and Scripting

add text to end of text file

Hi, I assume there is a simple solution, but as usual i can't find it! How can i add a line of text to the end of a text file on a new line? i.e file.txt ________________ this is my text file ________________ file.txt ________________ this is my text file WITH A NEW LINE... (6 Replies)
Discussion started by: leeRoberts2007
6 Replies

4. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

5. Shell Programming and Scripting

print string at the end of lines in text file

hello, I go text file like this E:/DDD/Dyndede/wwww E:/DDD/sss.com/ffffg/fff E:/DDD/vvvvvv/dd E:/DDD/sss.com/bbbbbb E:/DDD/sss.com/nnnn/xxI want to print /alpha.jpg at the end of every lines like that E:/DDD/Dyndede/wwww/alpha.jpg E:/DDD/sss.com/ffffg/fff/alpha.jpg... (8 Replies)
Discussion started by: davidkhan
8 Replies

6. Shell Programming and Scripting

while loop to add text to the end of a file

Hi all, I've got 2 files. File 1 has a list say a b c d e f File 2 got start= What I want is to create File 3 which look like this start=a,b,c,d,e,f So is it possible to loop throught File1 to echo it into File3 in one line? (3 Replies)
Discussion started by: stinkefisch
3 Replies

7. UNIX for Dummies Questions & Answers

Removing trailing lines at the end of a text file

How do you remove trailing empty lines at the end of a text file? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

8. Shell Programming and Scripting

Adding text to the end of the specific line in a file(only to the first occurrence of it)

Hi, I want to add a text to the end of the specific line in a file. Now my file looks like this: 999 111 222 333 111 444 I want to add the string " 555" to the end of the first line contaning 111. Moreover, I want to insert a newline after this line containg the "000" string. The... (8 Replies)
Discussion started by: wenclu
8 Replies

9. Windows & DOS: Issues & Discussions

2 Questions: replace text in txt file, add text to end of txt file

so... Lets assume I have a text file. The text file contains multiple "#" symbols. I want to replace all thos "#"s with a STRING using DOS/Batch I want to add a certain TEXT to the end of each line. How can I do this WITHOUT aid of sed, grep or anything linux related ? (1 Reply)
Discussion started by: pasc
1 Replies

10. UNIX for Dummies Questions & Answers

Search a file for certain strings and add them to the end of certain lines

I have a log file which lists groups and users in the following format GROUP1 user1 user2 user3 GROUP2 user4 user5 user6 GROUP3 user7 user8 I need to change the format to: user1|GROUP1 user2|GROUP1 user3|GROUP1 user4|GROUP2 (3 Replies)
Discussion started by: Angela S
3 Replies
TUTORIALS(1p)						User Contributed Perl Documentation					     TUTORIALS(1p)

NAME
PDL::Tutorials - A guide to PDL's tutorial documentation. MIGRATION
These are our migration guides for users familiar with other types of numerical analysis software. PDL::MATLAB Migration guide for MATLAB users. This page explains the key differences between MATLAB and PDL from the point of view of a MATLAB user. PDL::Scilab Migration guide for Scilab users. This page explains the key differences between Scilab and PDL from the point of view of a Scilab user. FOUNDATION
PDL::Philosophy Why did we write PDL? This document explains some of the history and motivation behind the Perl Data Language. It is an attempt to answer the question "Why PDL?". PDL::QuickStart Quick introduction to PDL features. A hands-on guide suitable for complete beginners. This page assumes no previous knowledge of Perl or PDL. PDL::Indexing After you have read the QuickStart guide, you should follow up with this document. This guide goes more deeply into the concepts of "indexing" and "slicing" and how they form the core of numerical analysis with PDL. INTERMEDIATE
PDL::Threading Threading is one of PDL's most powerful features. If you know MATLAB, you've heard of "vectorizing". Well, threading is like "vectorizing on steroids". It lets you make very fast and compact code by avoiding nested loops. All vector-based languages do this, but PDL generalizes the technique to all sorts of applications. This tutorial introduces PDL's threading feature, and it shows an example implementing Conway's Game of Life in 10 lines and 80 times faster than a classical implementation. PDL::BadValues Sometimes it is useful to specify that a certain value is "bad" or "missing". Scientific instruments some times include portions of invalid data. For example, a CCD camera might produce an image with over-exposed pixels. PDL's "bad values" feature gives you an easy way to deal with this sort of imperfect data. PDL::Tips Tips and suggestions for using PDL. This page is an assorted collection of programming tidbits that some PDL users have found useful. Some of these tips might be of help when you write your programs. ADVANCED
PDL::PP PDL's Pre-Processor is one of PDL's most powerful features. You write a function definition in special markup and the preprocessor generates real C code which can be compiled. With PDL:PP you get the full speed of native C code without having to deal with the full complexity of the C language. PDL::API A simple cookbook explaining how to create piddle manually, either from Perl or from C/XS code. This page covers the PDL core routines that comprise the PDL API. If you need to access piddles from C/XS, this is the document for you. PDL::Internals Description of the inner workings of the PDL module. Very few people need to see this. This page is mainly for PDL developers, or people interested in debugging PDL or changing the internals of PDL. If you can read this document and understand all of it, and you additionally understand PDL::PP, you will be awarded the title of "PDL Guru". COPYRIGHT
Copyright 2010 Daniel Carrera (dcarrera@gmail.com). You can distribute and/or modify this document under the same terms as the current Perl license. See: http://dev.perl.org/licenses/ perl v5.14.2 2012-01-02 TUTORIALS(1p)
All times are GMT -4. The time now is 07:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy