10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I have been searching how to do this but I can't seem to find how to do it. Hopefully someone can help.
I have multiplr files, 100's example 12345-zxys.213423.zyz.txt. I want to be able to take all these files and remove the first '12345-' from each of the files. '12345-' these characters... (5 Replies)
Discussion started by: israr75
5 Replies
2. Shell Programming and Scripting
I have been trying to insert a line after a regex but I can't do it. Here is the code I am using:
cat saved_doc
SET type = type1
SET type = STORE = y
/vol/san_e1
/vol/san_5
/vol/san_e9
/vol/san_e11
/vol/san_e12
/vol/san_e13
/vol/san_e14
/vol/san_e16
/vol/san_e17
/vol/san_e18... (4 Replies)
Discussion started by: newbie2010
4 Replies
3. UNIX for Dummies Questions & Answers
Here is my file:
700 7912345678910
61234567891234567891
700 8012345678910
61234567891234567891
I want to pull all lines that begin with '700' only if columns 11-12 are '79'.
My code so far only pulls the '79', not the whole line:
grep ^700 file1 | cut -c 11,12 |... (7 Replies)
Discussion started by: Scottie1954
7 Replies
4. Shell Programming and Scripting
Hi,
I was trying to remove the blank from beginning of a line.
when I try:
sed 's/^ +//' filename
it does not work
but when I try
sed 's/^ *//' filename
it works
But I think the first command should have also replaced any line with one or more blanks.
Kindly help me in understanding... (5 Replies)
Discussion started by: babom
5 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
Hi,
I am looking for any script which can do the following.
have to read a pattern from fileA and copy it to fileB.
fileA:
...
...
Header
...
...
..p1
...
...
fileB:
....
....
Header (3 Replies)
Discussion started by: anilvk
3 Replies
7. UNIX for Dummies Questions & Answers
hello all,
I wonder if anybody might be able to help with this.
I have file 1 and file2.
Both files may contain thousands of lines that have variable contents.
file1
234GH
5234BTW
89er
678tfg
234
234YT
tfg456
wert
78gt
gh23444 (7 Replies)
Discussion started by: Garrred
7 Replies
8. UNIX for Dummies Questions & Answers
How to add control characters at the end of each line in a file?
Can anyone help me with this?
Thanks,
Shobana (2 Replies)
Discussion started by: Shobana_s
2 Replies
9. Shell Programming and Scripting
Hi ,
the fog is fulling my brain after holidays , somebody can help me ?
I have a file in input like that :
toto
tata
tutu
and trying with awk to insert the compete file string as :
/dir1/dir2/toto
/dir1/dir2/tata
/dir1/dir2/tutu
i used to write :
awk 'BEGIN {FS="\\"} {print... (4 Replies)
Discussion started by: Nicol
4 Replies
10. Shell Programming and Scripting
Hi,
I have a file which contains many occurances of a string say "hellosunil".
I want to insert a newline charcater after all the "hellosunil" strings in the file.
trying to use sed,
sed -e 's/hellosunil/\\nhellosunil/g' file1
sed help says u cannot substitute a regular expression... (6 Replies)
Discussion started by: sunil_neha
6 Replies