10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello is it possible with awk or sed to replace any white space with the previous line characters in the same position?
I am asking this because the file I have doesn't always follow a pattern.
For example the file I have is the result of a command to obtain windows ACLs:
icacls C:\ /t... (5 Replies)
Discussion started by: nakaedu
5 Replies
2. Shell Programming and Scripting
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Discussion started by: thefang
10 Replies
3. Shell Programming and Scripting
I have a file which has a list in it
pop
triangle
people
slow
fast
What I want to do is search this list and replace people with humans do the list looks like this:
pop
triangle
human
slow
fast
I think i use something like this....
if cat /list.txt | grep -q 'people' ; then (9 Replies)
Discussion started by: digitalviking
9 Replies
4. Shell Programming and Scripting
Hi,
I'm attempting to rename some files that have spaces in them. Without linking sed commands together is it possible to replace the first three "." to " ".
File.name.is.long.ext -> File name is long.ext
I can get the desired effect with
echo "File.name.is.long.ext" | sed 's/\./ /g;s/... (5 Replies)
Discussion started by: vectox
5 Replies
5. Shell Programming and Scripting
hi,
when i am doing the following things getting error
Can anyone please suggest
i have a file where there is a line like the following
branch=dev sdf dev jin kilii fin kale boyle dev james dev
i want to search the existance of dev in the above line.
cat "$file" | sed -n... (8 Replies)
Discussion started by: millan
8 Replies
6. Shell Programming and Scripting
hi guys,
I want to do pattern matching with awk or sed but I don't know how. here's what I want:
I have a line number for a pattern that I have already found using grep, and I know a pattern like "---" that happens a few lines above that certain line number. I want to print out the chunk... (1 Reply)
Discussion started by: alirezan
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have several files with data that have to be imported to a database. These files contain records with separator characters. Some records are corrupt (2 separators are missing) and I need to correct them prior to importing them into the db.
Example:
... (5 Replies)
Discussion started by: stresing
5 Replies
8. UNIX for Dummies Questions & Answers
I am needing to replace a whole line of code in a file with a new line of code. This is what I need to do.
I need to replace.
$db_url = 'mysql://test_dev:test12@localhost/test';
With
$db_url = 'mysql://$dbuser:$dbpass@localhost/$dbase';
OK this is where it gets complicated. The... (4 Replies)
Discussion started by: filmguy
4 Replies
9. Shell Programming and Scripting
I know that this my be really simple, but I'm having a hard time accomplishing it. I am trying to add a new line of text after finding a particular string of text in a file. Here's what I'm getting:
sed: command garbled: N/search_string/\\new_text/
I was using "N" to add a line after the... (3 Replies)
Discussion started by: douknownam
3 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I know you can use sed with a line number to find a line in a file and print it but can for the life of me not remember or find the syntax today!
Any help greatly appreciated!
Thanks (2 Replies)
Discussion started by: maverick
2 Replies