inserting a variable to a new line


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting inserting a variable to a new line
# 8  
Old 06-09-2011
At command prompt I am trying to run .Yes I got output but that line was not inserted in the file. Please tell me how to insert the line using sed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Inserting a variable in awk script

I have file input.txt: >TX1-1 Freq 55 cattctgatgaatatttgtcctttagttgttatttgt >TX1-2 Freq 19 cattctgatgaatatttgtcctttagttgttatttgt >TX1-3 Freq 17 cattctgatgaatatttgtcctttagttgttatttgt >TX1-4 Freq 6 cattctgatgaatatttgtcctttagttgttatttgt >TX1-5 Freq 6 cattctgatgaatatttgtcctttagttgttatttgt ... (5 Replies)
Discussion started by: Xterra
5 Replies

2. UNIX for Dummies Questions & Answers

Inserting new line

Hi all, I want ot print a header with new line in the end. I am using echo like echo "this is header" I want output like This is header $ I tried -e also but it's not working. echo - e Can anyone help please? (6 Replies)
Discussion started by: dsa
6 Replies

3. Shell Programming and Scripting

Problem in inserting values of variable of shell

hi all, i have one shell script like this #!/bin/bash -xv ENV_NAME=`cat $IB_HOME_DIR/cfg/ibProfile.sh | grep "RDM_CONN" | cut -f 2 -d "@"` CURRENT_DIR=`pwd`; string=$IB_HOME_DIR string1="$string/FRGFOLDER/input" #sed "s/string3/$string1" frg_event_src.sql > modifiedinsert.sql sqlplus... (2 Replies)
Discussion started by: ramsavi
2 Replies

4. Shell Programming and Scripting

Inserting variable values in filename

Hi All, I have a directory containing multiple files. and also a txt file which contains the list of all filenames and certain values. I want to read the text file line by line and if its 2nd column is matched with the filename in directory, then it must insert the values in 7th column to... (14 Replies)
Discussion started by: CAch
14 Replies

5. Shell Programming and Scripting

Commenting a specific line and inserting a new line after commented line.

Hello All, I have following file contents cat file #line=aaaaaa #line=bbbbbb #line=cccccc #line=dddddd line=eeeeee #comment=11111 #comment=22222 #comment=33333 #comment=44444 comment=55555 Testing script Good Luck! I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
19 Replies

6. Shell Programming and Scripting

Inserting a line in a file after every alternate line

Friends , I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated. My File control station *ATM* , qread $OSS.Jul13A.FI01 interval 1 intcount 1 control station *ATM* , qread $OSS.Jul13A.FI02 interval 1 intcount... (4 Replies)
Discussion started by: appu2176
4 Replies

7. Shell Programming and Scripting

Inserting a line when its length is variable

Hi Unix experts I have simple text files in which the number of lines vary from one file to another. They look like the following: # # . . 34 46 76 72 39 68 I want to grab the first number of the last line of each file (let's say A= 39 in the above example), which is... (2 Replies)
Discussion started by: nxp
2 Replies

8. Shell Programming and Scripting

Inserting variable value into filename

Greetings, people of UNIX/Linux forums. I am having a problem with a script, where I am trying to create a new variable. The value of this variable would be dependent on the value in a couple other previous variables (all variables are 2-digit integers). Here is my code: #set the stations... (3 Replies)
Discussion started by: TheSMan5
3 Replies

9. UNIX for Advanced & Expert Users

Inserting a line before the line which matches the patter

Hi Is there any command where we can insert a line "2|||" before every line starting with "3|" my input is as follows 1|ETG|12345 3|79.58|||GBP|| 1|ETG|12345 3|79.58|||GBP|| 1|ETG|12345 2|EN_GB||Electrogalvanize 0.5 m2 ( Renault ) 1|ETG|12345 3|88.51|||GBP|| desired output... (10 Replies)
Discussion started by: laxmi131
10 Replies

10. Shell Programming and Scripting

Inserting a new line

I have a file where each line starts with a "update" statement. I want to insert a new line, after each line, with the words "go" in the new line. Can someone help me out with this? (1 Reply)
Discussion started by: ssmallya
1 Replies
Login or Register to Ask a Question
JODREPORTS(1)						      General Commands Manual						     JODREPORTS(1)

NAME
jodreports - use libjodreports-java directly from the command line to merge OpenDocument text with data SYNOPSIS
jodreports <template-document> <data-file> <output-document> DESCRIPTION
jodreports is a java program that merge OpenDocument text with data by using libjodreports-java. The command line tool is especially useful to test templates while you are adding instructions to them. You use a .properties or .xml file to contain the <data-file> to be merged into the template. The <template-document> needs to be an existing OpenDocument text with simple fields. A field that will be replaced with the value of a variable passed can be specified using the standard FreeMarker expression notation by typing the variable name into the doc- ument as follows Hi ${name}! here name will be replaced with the value passed in at runtime. However, mixing processing instructions and normal text into the document may become confusing and clutter the layout. So JOOReports pro- vides an alternative way of inserting fields. You can insert a visual field in OpenOffice.org Writer from the menu Insert / Fields / Other... (or just press Ctrl+F2), then click on the Functions tab and select Input field. Change the field Reference to JOOScript and in the following field Content enter the variable name (e.g. "$name"). This field will typically be displayed by Writer as a grayed rectangle with the variable name, while moving the mouse over it will reveal the field reference. This is a nice way of keeping processing instructions separate from the document layout and is thus the recommended approach. Whatever you specify as the field Reference will be treated as a FreeMarker ${...} expression, so it could also be something more complex than a simple variable name. To insert more advanced instructions, e.g. for conditionally displaying a portion of text, or repeating a table row for each item in a col- lection, you can use FreeMarker directives. A simple directive is assign. You can use it to define a new variable, for example [#assign totalPrice = unitPrice * quantity] Note that we always use the alternative (square bracket) syntax for FreeMarker directives. While it may be possible to insert this directive directly as text into the template, this does not always work (for reasons we'll see below) and as mentioned mixing instructions into the document is a practice we want to avoid anyway. For this reason, JOOReports lets you insert FreeMarker directives as scripts. You can insert a script in Writer from the menu Insert / Script..., then change the Script type to JOOScript and insert any FreeMarker directives in the script Text box. A script will be displayed by Writer as a small green rectangle, and you can double click on it to open it and modify it. So you directive will be executed at the point where the script has been inserted. This is ok for something like assign but as we'll see will not work for something like list. Alternatively, you can insert a FreeMarker directive in OpenOffice.org Writer from the menu Insert / Fields / Other... (or just press Ctrl+F2), then click on the Functions tab and select Input field. Change the field Reference to JOOScript and in the following field Con- tent enter the directive (e.g. "[#assign title='Mr.']"). Sample Open Document Template Again this provides a nice way to insert processing instructions and keept them separate from the document layout. The <output-document> is also an OpenDocument text and will be created as the result of the merge. JOOReports uses FreeMarker as its template engine. FILES
/usr/share/java/jodreports.jar AUTHOR
jodreports was written by Mirko Nasato <mirko@artofsolving.com> and Terry Liang <terry@polonious.com.au>. jodreports was packaged for the Debian project by Sascha Girrulat <sascha@girrulat.de>. This manual page was written by Sascha Girrulat <sascha@girrulat.de>, for the Debian project (and may be used by others). Most of the used information are reused from http://jodreports.sourceforge.net. User Manuals January 30, 2011 JODREPORTS(1)