10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I have multiple files on a directory with the following content:
blahblah
blahblah
hostname server1
blahblah
blahblah
---BEGIN---
aaa
bbb
ccc
ddd
---END---
blahblah
blahblah
blahblah
I would like to filter all the files with awk or sed or something else so I can get below... (6 Replies)
Discussion started by: bayupw
6 Replies
2. Shell Programming and Scripting
cat file |grep -v "xx" | grep -v "yy" |grep -v "zz" (3 Replies)
Discussion started by: yanglei_fage
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I require to replace 2 items:
1. replace start of all lines in a file with ' except the first line
2. replace end of all lines in a file with '||chr( except last line
I am able to do the entire file using
sed -e s/^/\'/g -e s/$/\'\|\|chr\(/g "$file" > newfile.txt
but am not yet... (3 Replies)
Discussion started by: Chella15
3 Replies
4. Shell Programming and Scripting
I'm looking for SED equivalent for grep -w -f. All I want is to search a list of patterns from a file. Also If the pattern doesn't match I do not want "null returned", rather I would prefer some text as place holder say "BLANK LINE" as I intend to process the output file based on line number.
... (1 Reply)
Discussion started by: novice_man
1 Replies
5. Shell Programming and Scripting
Here is my problem.
I have a list of phone numbers that I want to use only the last 4 digits as PINs for something I am working on. I have all the numbers in a file but now I want to be removed all items EXCEPT the last 4 digits.
I have seen sed commands and some grep commands but I am... (10 Replies)
Discussion started by: Sucio
10 Replies
6. Shell Programming and Scripting
Hello
I have created the following script, which is designed to manipulate a text document:
#!/bin/sh
# Get 3 lines, (last of which is "Quantity"); adjust order; put all three on one line with tabs.
FILENAME=~/Desktop/email.txt
LIST=$(grep -B2 "Quantity" ${FILENAME} |awk 'BEGIN { FS = "\n"; RS... (6 Replies)
Discussion started by: benwiggy
6 Replies
7. UNIX for Dummies Questions & Answers
I'm trying to parse out DNS logs from dozens of different domain controllers over a large period of time. The logs are rolled up into individual text files by size, which may contain only a portion of a day's activity or several day's worth (depending on amount of activity). I'm splitting them by... (4 Replies)
Discussion started by: seanwpaul
4 Replies
8. UNIX Desktop Questions & Answers
I'm having trouble with extracting certain lines from a file based on whether they have all the required fields.
Original file:
snt:594:Sam N This
bpt:2342:Bob P That
lr:123
wrp:23:Whoever Person
cor:794
Desired output:
snt:594:Sam N This
bpt:2342:Bob P That
wrp:23:Whoever Person
... (3 Replies)
Discussion started by: Chthonic
3 Replies
9. Shell Programming and Scripting
Hi. This is my first post on the forums.
I am trying to write a script that will parse a folder of files "oneverylongfilenamexyz.pdf" and create a .dat file named "oneverylongfilenamexyz.dat" with the first line of each .dat file saying variable="xyz" where xyz is the last 14 characters of $i... (4 Replies)
Discussion started by: attonbitusira
4 Replies
10. Shell Programming and Scripting
hello experts,
I need a sed command that remove last 10 characters of a line start from 3rd line.
any suggestions?
Thanks you (7 Replies)
Discussion started by: minifish
7 Replies