10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account.
$ head -500 x.txt y.txt
==> x.txt <==
TEST01 APP_USER_PROFILE
USER03 APP_USER_PROFILE
TEST02 APP_USER_EXP_PROFILE
TEST04 APP_USER_PROFILE
USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
2. UNIX for Beginners Questions & Answers
I have to split a file containing 100 lines to 5 files say from lines ,1-20 ,21-30 ,31-40 ,51-60 ,61-100
Here is i can do it for 2 file but how to handle it for more than 2 files
awk 'NR < 21{ print >> "a"; next } {print >> "b" }' $input_file
Please advidse.
Thanks (4 Replies)
Discussion started by: abhaydas
4 Replies
3. 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
4. UNIX for Dummies Questions & Answers
Can u pls advise the unix command as I have a file which contain the records in the below format
333434
435435
435443
434543
343536
Now the total line count is 89380 , now i want to create a separate
I am trying to split my large big file into small bits using the line... (2 Replies)
Discussion started by: punpun66
2 Replies
5. 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
6. Shell Programming and Scripting
I am trying to redirect record to two files using nawk if-else.
#Identify good and bad records and redirect records using if-then-else
nawk -F"|" '{if(NF!=14){printf("%s\n",$0) >> "$fn"_bad_data}else{printf("%s\n",$0) >> $fn}}' "$fn".orig
"$fn".orig is the source file name
bad... (7 Replies)
Discussion started by: siteregsam
7 Replies
7. Shell Programming and Scripting
Hi,
I have a comma (,) delimited file, in which few fields are enclosed with in double quotes " ". I have to print the records in the file which donot have expected number of field with the line number.
File1
====
name,desgnation,doj,project #header#... (7 Replies)
Discussion started by: machomaddy
7 Replies
8. Shell Programming and Scripting
Example CSV:
$ cat myfile
HDR
COL_A,COL_B,COL_C
X,Y,Z
Z,Y,X
...
X,W,Z
In this example, I know that column names are on the second line. I also know that I would like to print lines where COL_A="X" and COL_C="Z". In this simple example, I know that COL_A = $1 and COL_C = $3, and hence... (6 Replies)
Discussion started by: cs03dmj
6 Replies
9. Shell Programming and Scripting
I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want.
The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies
10. UNIX for Dummies Questions & Answers
I have the the following question:
# cat report.lis | nawk -F: '{ if($0 ~ "^BE NO:") print "report_"$2".lis"}' :confused:
.lisrt_ 111
.lisrt_ 111
.lisrt_ 222
.lisrt_ 222
.lisrt_ 333
.lisrt_ 333
# cat report.lis | nawk -F: '{ if($0 ~ "^BE NO:") print "report_" $2}'
report_ 111
report_... (2 Replies)
Discussion started by: raychu65
2 Replies