10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
Greetings.
I've got a csv file with data along these lines:
Spumoni's Pizza Place, Placemats n Things, Just Lamps
Counterfeit Dollars by Vinnie, Just Shades, Dollar StoreI want to replace the entire comma-delimited field if it matches something ending in "Place" or beginning with "Dollar",... (2 Replies)
Discussion started by: palmfrond
2 Replies
4. Shell Programming and Scripting
Hi,
I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated with "|".
I am looking for some command/option to join these two in single command parameter.
... (6 Replies)
Discussion started by: bhupinder08
6 Replies
5. UNIX for Dummies Questions & Answers
Hi,
Need some help with sed.
I have a file that has sections :
e.g.
a=blah
b=blah
d=blah
e=blah
There's many sections in the file. (1 Reply)
Discussion started by: andyatit
1 Replies
6. Windows & DOS: Issues & Discussions
Well here goes:
I tried to write a batch file that adds a specific fixed text to each line of an already existing text file.
for the adding text infront of each line I tried this:
for /F "delims=" %%j in (list.txt) do echo.STARTTEXT\%%j >> list.txt
for adding text after each line I... (6 Replies)
Discussion started by: pasc
6 Replies
7. UNIX for Dummies Questions & Answers
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Discussion started by: cokedude
3 Replies
8. UNIX for Dummies Questions & Answers
How can I specify special meaning characters like ^ or $ inside a regex range. e.g
Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character.
I tried the following but it does not work:
sed 's/\(\)/<do something here>/g' file1
... (3 Replies)
Discussion started by: jawsnnn
3 Replies
9. Shell Programming and Scripting
Hi All,
I have a file as below:
cat myfile
abcdef
NA
rwer
tyujkl
na
I wish to add the text ".txt" at the end of all lines except the lines starting with NA or na.
I know i can add text at the end of line using following command but I am not sure how to valiate the condition. (14 Replies)
Discussion started by: angshuman
14 Replies
10. Shell Programming and Scripting
Hi, excuse me for my poor english.
My problem is that:
I have a File
i want to add to each line of that file two strings: one at the beginning of the line, one at the ending.
string1="abcd"
string2="efgh"
i want $string1 content $string2 for each line.
Is that possible? (3 Replies)
Discussion started by: Linux-fueled
3 Replies