Sponsored Content
Top Forums Shell Programming and Scripting insert line into file using variable Post 302306345 by aimmanuel on Sunday 12th of April 2009 11:30:26 AM
Old 04-12-2009
exactly Vidhayadhar. Thanks
My actual file also has / operator in the inline text as well as in the replacement text. How I can integrate the /. After function x before </head> and </script>

example:
after function (x)

line inserted

</script>

</head>
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Insert a line as the first line into a very huge file

Hello, I need to insert a line (like a header) as the first line of a very huge file (about 3 ml rows). I am able to do it with sed, but redirecting the output and creating a new file takes quite some time. I was wondering if there was a more efficient way of doing it? Any help would be... (3 Replies)
Discussion started by: shriek
3 Replies

2. Shell Programming and Scripting

insert a variable in the last column of a file

i want to insert a variable in the last column of a file, the columns are separated by "|". I want to insert the variable in everyline of the file . (7 Replies)
Discussion started by: dineshr85
7 Replies

3. Shell Programming and Scripting

Insert text into file depending on variable

Hey guys , i have a variable with the contents ... NUMBER=4 and a test file with the contents 1248 1213 1214 1278 1200 3045 3444 2130 I want to execute a script that will produce the following output ( based on NUMBER=4) to be ... create 1248 (1 Reply)
Discussion started by: theshams
1 Replies

4. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

5. Shell Programming and Scripting

script to insert variable file into another, bit like C's #include

Hi, I want to insert one file into another like this: file 1: 1 2 3 <!-- #include file="file2" --> 4 5 <!-- #include file="file3" --> 6 with the complete output going to another file. Have seen some solutions to similar problems using sed, but this problem is different because it is... (5 Replies)
Discussion started by: cvq
5 Replies

6. Shell Programming and Scripting

Insert a new line before every 5th line in a file

Hi, I need to insert a new line containing the string "QUERY" above every 5 lines. The below piece of code inserts a new line after every 5th line awk '{print $0} !(NR%5) {print "QUERY"}' sed 'n;n;n;n;G;' --> I do not know how to give "QUERY" string here But I need to insert it before... (4 Replies)
Discussion started by: royalibrahim
4 Replies

7. Shell Programming and Scripting

Insert value of env variable in xml file

Hello, I have the following variables set in my env echo $MY_XSD_FILE /home/jak/sample.xsd echo $MY_INTERVAL_VALUE 4 I want to insert them between the xml tags in my xml file cat sample.xml ::::::::::::::: ::::::::::::::: <property name="FILE"></property> :::::::::::::::::::::::... (2 Replies)
Discussion started by: jakSun8
2 Replies

8. Shell Programming and Scripting

How to read a text file line by line and insert into a database table?

I have a test file that I want to read and insert only certain lines into the the table based on a filter. 1. Rread the log file 12 Hours back Getdate() -12 Hours 2. Extract the following information on for lines that say "DUMP is complete" A. Date B. Database Name C.... (2 Replies)
Discussion started by: JolietJake
2 Replies

9. UNIX for Beginners Questions & Answers

Insert a line of text on nth line of a file

Hi All, I am using UNix Sun OS sun4u sparc SUNW,SPARC-Enterprise My intention is to insert a line of text after 13th line of every file inside a particular directory. While trying to do it for a single file , i am using sed sed '3 i this is the 4th line' filename sed: command garbled: 3... (5 Replies)
Discussion started by: gotamp
5 Replies

10. UNIX for Beginners Questions & Answers

Bash: Insert in a variable a file

hi all i have a problem in the bash shell. i'd like insert in a variable a file for example : i have a file datafine.log in this file there is : 17/JUN/2019 i want to insert the value of datafine.log in a variable. Regards Frncesco edit by bakunin: please use CODE-tags for your data... (2 Replies)
Discussion started by: Francesco_IT
2 Replies
std::fpos< _StateT >(3) 				     Library Functions Manual					   std::fpos< _StateT >(3)

NAME
std::fpos< _StateT > - SYNOPSIS
Public Member Functions fpos (streamoff __off) operator streamoff () const fpos operator+ (streamoff __off) const fpos & operator+= (streamoff __off) fpos operator- (streamoff __off) const streamoff operator- (const fpos &__other) const fpos & operator-= (streamoff __off) void state (_StateT __st) _StateT state () const Detailed Description template<typename _StateT>class std::fpos< _StateT > Class representing stream positions. The standard places no requirements upon the template parameter StateT. In this implementation StateT must be DefaultConstructible, CopyConstructible and Assignable. The standard only requires that fpos should contain a member of type StateT. In this implementation it also contains an offset stored as a signed integer. Parameters: StateT Type passed to and returned from state(). Definition at line 112 of file postypes.h. Constructor &; Destructor Documentation template<typename _StateT> std::fpos< _StateT >::fpos (streamoff__off) [inline] Construct position from offset. Definition at line 133 of file postypes.h. Member Function Documentation template<typename _StateT> std::fpos< _StateT >::operator streamoff () const [inline] Convert to streamoff. Definition at line 137 of file postypes.h. template<typename _StateT> fpos std::fpos< _StateT >::operator+ (streamoff__off) const [inline] Add position and offset. Definition at line 178 of file postypes.h. template<typename _StateT> fpos& std::fpos< _StateT >::operator+= (streamoff__off) [inline] Add offset to this position. Definition at line 154 of file postypes.h. template<typename _StateT> fpos std::fpos< _StateT >::operator- (streamoff__off) const [inline] Subtract offset from position. Definition at line 192 of file postypes.h. template<typename _StateT> streamoff std::fpos< _StateT >::operator- (const fpos< _StateT > &__other) const [inline] Subtract position to return offset. Definition at line 205 of file postypes.h. template<typename _StateT> fpos& std::fpos< _StateT >::operator-= (streamoff__off) [inline] Subtract offset from this position. Definition at line 165 of file postypes.h. template<typename _StateT> void std::fpos< _StateT >::state (_StateT__st) [inline] Remember the value of st. Definition at line 141 of file postypes.h. template<typename _StateT> _StateT std::fpos< _StateT >::state () const [inline] Return the last set value of st. Definition at line 146 of file postypes.h. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Jun 10 2014 std::fpos< _StateT >(3)
All times are GMT -4. The time now is 05:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy