10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
input:
AA|BB|CC
DD|EE
FF
what I am trying to get:
AA|BB|CC
DD|EE|
FF||
I tried to create first an UDF for printing repeats, but I think I have an issue with my END section or my array:
function repeat(str, n, rep, i)
{
for(i=1 ;i<n;i++)
rep=rep str
return rep
}
... (6 Replies)
Discussion started by: beca123456
6 Replies
2. Shell Programming and Scripting
Hey guys,
I want to do something quite simple but I just can't no matter what I try. I have a large file and i usually just:
gzcat test.gz | nohup /test/this-script-does-things-to-the-records.pl -> /testdir/tmp_test.txt
But now I need to do it only for the first 100k records. I sure... (7 Replies)
Discussion started by: sg3
7 Replies
3. Shell Programming and Scripting
Hi Freinds ,
I have 2 files .
File 1
|nag|HYd|1|Che
|esw|Gun|2|hyd
|pra|bhe|3|hyd
|omu|hei|4|bnsj
|uer|oeri|5|uery
File 2
|nag|HYd|1|Che
|esw|Gun|2|hyd
|uer|oi|3|uery
output : (9 Replies)
Discussion started by: i150371485
9 Replies
4. Shell Programming and Scripting
I would like to print the number of records of 2 files, and divide the two numbers
awk '{print NR}' file1 > output1
awk '{print NR}' file2 > output2
paste output1 output2 > output
awl '{print $1/$2}' output > output_2
is there a faster way? (8 Replies)
Discussion started by: programmerc
8 Replies
5. Shell Programming and Scripting
Hi all,
I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using,
grep -c . sample.txtor
wc -l < sample.txt or
awk 'END {print NR}' sample.txtAll these commands shows the count as 1, which means they are reading only the first header line of the file.... (3 Replies)
Discussion started by: mehar
3 Replies
6. Shell Programming and Scripting
Hi awk Gurus,
I have file as below :
file1.txt
7000,2,1,6
7001,2,1,7
7002,2,1,6
7003,1,2,1
file2.txt
7000,john,2,0,0,1,6
7000,john,2,0,0,1,7
7000,john,2,0,0,1,8
7000,john,2,0,0,1,9
7001,elen,2,0,0,1,7
7002,sami,2,0,0,1,6
7003,mike,1,0,0,2,1 (13 Replies)
Discussion started by: arunshankar.c
13 Replies
7. Shell Programming and Scripting
I am doing a loading process. I am loading data from a Oracle source to Oracle target.
For example there is an SQL statement:
Insert into emp_1
Select * from emp_2 where deptno=20;
In this case my source is emp_2 and loading into my target table emp_1. This process is automated. Now I... (3 Replies)
Discussion started by: karthikkasarla
3 Replies
8. Shell Programming and Scripting
Hi,
I have CSV file which looks like below, i want to calulate number of records for each brand say SOLO_UNBEATABLE E and SOLO_UNBEATABLE F combined and record count is say 20 . i want to calculate for each brand, and here only first record will have all data and rest of record for the brand... (2 Replies)
Discussion started by: raghavendra.cse
2 Replies
9. Shell Programming and Scripting
Initially i store some files into anothe file Y. Now i want read the contents of file Y one by one do some check on each file.
i,e
Open file Y (contains multiple files)
First read a file , do some check on that individual file.If that file satisfies teh condition put it in another file.
Now... (1 Reply)
Discussion started by: vasuarjula
1 Replies
10. Shell Programming and Scripting
hi gurus
i'm trying to get the count of number of records of a file
as : wc -l file1.txt
iam getting the correct count by in out put i'm getting the file name too
i get the output as follows "7 file1.txt"
my question is how to avoid filename in the output.
might be a basic... (20 Replies)
Discussion started by: sish78
20 Replies