Sponsored Content
Top Forums Shell Programming and Scripting Script to add backslashes to end of certain lines of text Post 302762591 by icskittles on Monday 28th of January 2013 05:45:52 PM
Old 01-28-2013
Sweet, thank you! I just changed it slightly so that it only adds the backslashes for lines with text in them:
Code:
awk '!/^\\begin/&&!/^$/&&!/^\\end/{$0=$0"\\\\"}1' filename

 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. Shell Programming and Scripting

adding text to the end of lines containing a word

I'm new to shell scripting, and need to add a series of commands to the ends of certain lines of text that contain a keyword. Any easy way to do this? Thanks (2 Replies)
Discussion started by: ironwall
2 Replies

4. 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

5. Shell Programming and Scripting

Append text to end of line on all lines

Hi, I've spent some time researching for this but can't seem to find a solution. I have a file like this 1234|Test|20101111|18:00|19:00There will be multiple lines in the file with the same kind of format. For every line I need to make it this 1234|Test|20101111|18:00|19:00||create... (5 Replies)
Discussion started by: giles.cardew
5 Replies

6. 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

7. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies

8. 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

9. Shell Programming and Scripting

Add text to the end of line

Seems simple but ive been searching for a good hour of so I have a text file and would like to add a string to the end of line 5 ( as an example) to ake tings hard the line number we have to add the text to is stored in a variable cunningly name $Line_to_append any ideas on how this could... (2 Replies)
Discussion started by: dunryc
2 Replies

10. Shell Programming and Scripting

Selecting text on multiple lines, then removing a beginning and end patterns

I have a file similar to the below. I am selecting only the paragraphs with @inlineifset. I am using the following command sed '/@inlineifset/,/^ *$/!d; s/@inlineifset{mrg, @btpar{@//' $flnm >> $ofln This produces @section Correlations between seismograms,,,,}} ... (5 Replies)
Discussion started by: Danette
5 Replies
Class::DBI::Sweet::Topping(3pm) 			User Contributed Perl Documentation			   Class::DBI::Sweet::Topping(3pm)

NAME
Class::DBI::Sweet::Topping - Topping for Class::DBI::Sweet SYNOPSIS
MyApp::Article->find_title_and_created_on( $title, $created_on ); MyApp::Article->search_title_and_created_on( $title, $created_on ); MyApp::Article->count_title_and_created_on( $title, $created_on ); MyApp::Article->page_title_and_created_on( $title, $created_on ); MyApp::Article->next_by_created_by( { order_by => 'created_on' } ); MyApp::Article->previous_by_created_by( { order_by => 'created_on' } ); DESCRIPTION
Class::DBI::Sweet::Topping provides a convenient AUTOLOAD for search, page, retrieve_next and retrieve_previous. AUTHORS
Christian Hansen <ch@ngmedia.com> Matt S Trout <mstrout@cpan.org> Sebastian Riedel <sri@oook.de> THANKS TO
Danijel Milicevic, Jesse Sheidlower, Marcus Ramberg, Viljo Marrandi SUPPORT
#catalyst on <irc://irc.perl.org> <http://lists.rawmode.org/mailman/listinfo/catalyst> <http://lists.rawmode.org/mailman/listinfo/catalyst-dev> LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Class::DBI::Sweet Catalyst perl v5.10.1 2010-04-22 Class::DBI::Sweet::Topping(3pm)
All times are GMT -4. The time now is 05:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy