10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello.
Here is a file contents :
declare -Ax NEW_FORCE_IGNORE_ARRAY=(="§" ="§" ="§" ="§" ="§" .................. ="§"Here is a pattern
=I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '='
Is there a better solution than mine :... (3 Replies)
Discussion started by: jcdole
3 Replies
2. UNIX for Beginners Questions & Answers
Hi,
Sure it's an easy one, but it drives me insane.
input ("|" separated):
1|A,B,C,A
2|A,D,D
3|A,B,B
I would like to count the occurence of each capital letters in $2 across the entire file, knowing that duplicates in each record count as 1.
I am trying to get this output... (5 Replies)
Discussion started by: beca123456
5 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I couldn't figure how to extract until last occurence of a character.
I have the string ./dir1/file1/abc.sh
The output should be /dir1/file1
So, the command should display the path until last occurence of "/".
Thanks. (3 Replies)
Discussion started by: rajivn786
3 Replies
4. Shell Programming and Scripting
I have a file
# cat asasas
AAAAAA
11
22
33
44
BBBBB
NILNILNIL
AAAAAA
22
33
44
55
66
77
88
BBBBB
NILNILNIL (2 Replies)
Discussion started by: anil510
2 Replies
5. UNIX for Dummies Questions & Answers
This is the output from ps -ef cmd . I have to extract the fourth (C) and the seventh (TIME) field
root 3932344 3801216 Apr 08 - 0:00 /usr/sbin/rsct/bin/ERrmd
root 3997836 1 0 Apr 08 - 0:00 /usr/sbin/uprintfd
root 4128894 3801216 0 Apr 08 - 0:09... (3 Replies)
Discussion started by: Anu_1
3 Replies
6. Shell Programming and Scripting
Hi,
I have a file with colon separated values like below. How can i get those lines whose third field is 0 (zero). In the below example, lines starting with stapler and tempo has its third field as 0
$ cat list.txt
galaxy:b:5:world
stapler:a:0:hello
abc:a:4:stomper
kepler:uic:5:jam... (8 Replies)
Discussion started by: John K
8 Replies
7. Shell Programming and Scripting
I have an input file with content like :
18:51:18 | 217863|Acct 0110855565|RC 17608| 16 Subs| 1596 UsgRecs| 2 Secs| 430 CPUms| prmis2:26213 <MoveUsage d
aemon needs to run on this account before it can be billed.>
23:03:30 | 896529|Acct 2063947620|RC 17608| 8 Subs| 148 UsgRecs| ... (9 Replies)
Discussion started by: Rajesh Putnala
9 Replies
8. UNIX for Dummies Questions & Answers
EDIT: This problem has been solved thanks to the help of scottn.
Okay, so I have a CSV. Let's say it has the following entries in it:
Jackie Chan,1954,M
Chuck Norris,1930,M
Bruce Lee,1940,M
How would I, for example, extract the gender out of a certain person, maybe based on the year of... (12 Replies)
Discussion started by: chickeneaterguy
12 Replies
9. Shell Programming and Scripting
Hi,
I'm a newbie to shell scripting and have searched the forum but couldn't find what i was looking for.
Basically I have a list of filenames like...
123-fileone.txt
I want to be able to extract the prefix up to the first '-'. So I'd end up with 123. I have attempted it using a pretty... (2 Replies)
Discussion started by: kirkg
2 Replies
10. UNIX for Dummies Questions & Answers
below are the contents of file 'tmp.out':
2|34|534|
1|355|54|
1|443|34|
3|43|768|
3|7|887|
1|9|990|
How do I extract the 2nd and 3rd columns of file 'tmp.out' only when the first column equals '1'.
Note that this file will be huge; atleast 5million+ rows, so I want to avoid looping... (4 Replies)
Discussion started by: ChicagoBlues
4 Replies