10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am doing something like below:
cat file1>file3and
cat file2>>file3
I wanted to check if there is a way to write a custom message(hardcoded message)something like below at the beginning of each line then PIPE delimitiation and then followed by remaining record.
cat file1... (7 Replies)
Discussion started by: Saanvi1
7 Replies
2. 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
3. Shell Programming and Scripting
I need to comment the lines starting with pattern "exclude" or "exclude=". If the work exclude comes at any other part, ignore it. Also, ignore, excludes, excluded etc. Ie only comment the line starting with exclude.
File contents.
exclude
exclude=
hi I am excluded
excludes
excludes=
... (9 Replies)
Discussion started by: anil510
9 Replies
4. 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
5. 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
6. Shell Programming and Scripting
How can I delete spaces at the begining of all lines of my file ? (2 Replies)
Discussion started by: Sara_84
2 Replies
7. Shell Programming and Scripting
hey,
i would like to add a line number to the beginning like so:
red
blue
green
yellow
will be:
1=>red
2=>blue
3=>green
4=>yellowplease advise
thank u. (5 Replies)
Discussion started by: boaz733
5 Replies
8. Shell Programming and Scripting
My current output is as follows:
All Day Event
Someone's Birthday
Class 7:00 PM
Pick up dry cleaning 1:00 PM
Wake up 8:00 AM
I'd like the output to remain the same but have the times moved to the beginning of the line with a hyphen after it so it would look like,
All Day Event... (3 Replies)
Discussion started by: chrish
3 Replies
9. Shell Programming and Scripting
Hello -
I am running Linux. I want to place a comment char at the beginning of a line in a file. For example:
testvar=`grep username /etc/people
sed -e 's/$testvar/#$testvar/g' /etc/people
I cannot get the above commands to put a comment at the beginning of the line.
Any... (3 Replies)
Discussion started by: mlike
3 Replies
10. Shell Programming and Scripting
Could anybody help me.
I need to create a script that reads a text file from STDIN and prints out the file to STDOUT with line numbers at the beginning of each line.
Thanks. (5 Replies)
Discussion started by: mascorro
5 Replies