9 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
2. Shell Programming and Scripting
I want to basically do the below thing. Suppose there is a tag called object1. I want to display an output for all similar tag values under heading of Object 1 and the count of the xmls. Please help
File:
<xml><object1>house</object1><object2>child</object2>... (9 Replies)
Discussion started by: srkmish
9 Replies
3. Shell Programming and Scripting
Hi,
I'm running a DB query which returns names of people and writes it in a text file as shown below:
Carey, Jim; Cena, John
Cena, John
Sen, Tim; Burt, Terrence
Lock, Jessey; Carey, Jim
Norris, Chuck; Lee, Bruce
Rock, Dwayne; Lee, Bruce
I want to use awk and get all the names... (9 Replies)
Discussion started by: prashu_g
9 Replies
4. Shell Programming and Scripting
Hi,
I have a text file with the following content:
monday,20
tuesday,10
wednesday,29
monday,10
friday,12
wednesday,14
monday,15
thursday,34
i want the following output:
monday,45
tuesday,10
wednesday,43
friday,12 (3 Replies)
Discussion started by: prashu_g
3 Replies
5. Programming
Hello! Iam trying to reverse my order of quicksort in C from asc order (1-99) that is the original way of the algoritm, to descending (99-1). I've tried so many ways that iam a kind of lost now!:s
The original quicksort is:
void swap(int* a, int* B) {
int tmp;
tmp = *a;
*a = *b;
... (1 Reply)
Discussion started by: rafazz
1 Replies
6. Shell Programming and Scripting
I have columnar data in arrays perl, Example -
@a = (1,2,3);
@array1 = (A,B,C);
@array2 = (D,E,F);
@array3 = (I,R,T);
I want the data to be formatted and printed as
1 A D I
2 B E F
3 C F T
and so on... (8 Replies)
Discussion started by: dinjo_jo
8 Replies
7. Shell Programming and Scripting
I have a list of id;
for example: file 1
dfghd
dfghe
dfgey
dfgeu
I have another data file that contain this ids as headers;
for ex. file2
>dfghd
gfdgfddl;klfkld;ld;lgl;dld'l'dv
>dfghe
gkwhjhsgdjdjdjhjddj
>dfgey
jdkjfhdjhfdkjhfdkhkdk
I wanted to compare file 1 and file 2... (1 Reply)
Discussion started by: Lucky Ali
1 Replies
8. UNIX for Dummies Questions & Answers
Can any one please say about the below,
using,
grep -v "name" file.txt
the result of above command will be it will print all the lines except the line which having the word "name"
similarly,
nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print;c=a}b{r=$0}' b=0 a=1 s="name" file.txt
... (7 Replies)
Discussion started by: prsam
7 Replies
9. Shell Programming and Scripting
in csh
set x = "/home/usr/dir1/file1"
if i do:
echo $x | awk -F\/ '{print $NF}'
will result to:
"file1"
how do i invert the output to:
"/home/usr/dir1"
:confused: (2 Replies)
Discussion started by: jehrome_rando
2 Replies