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. Shell Programming and Scripting
The below code works great, kindly provided by @Don Cragun, the lines in bold print the current output. Since some of the fields printed can be blank some of the fields are shifted. I can not seem too add . to the blank fields like in the desired output. Basically, if there is nothing in the field... (10 Replies)
Discussion started by: cmccabe
10 Replies
3. Shell Programming and Scripting
A record contains 50 fields separated by "~". I need to assign each of these fields to different variables. Following is the shell script approach I tried.
RECORD="FIELD1~FIELD2~FIELD3~FIELD4~FIELD5~...........~FIELD50"
VAR1=$(echo ${RECORD} | cut -d"~" -f 1)
VAR2=$(echo ${RECORD} | cut... (5 Replies)
Discussion started by: krishmaths
5 Replies
4. Shell Programming and Scripting
Hi
I have a file as below
<field1> <field2> <field3> ... <field_num1> <field_num2>
Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields.
I tried this and it doesn't sort on the difference field .. Appreciate your help.
cat... (9 Replies)
Discussion started by: newstart
9 Replies
5. Shell Programming and Scripting
I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Discussion started by: sljnk
7 Replies
6. Shell Programming and Scripting
Hi experts,
I need to print the first field first then last two fields should come next and then i need to print rest of the fields.
Input :
a1,abc,jsd,fhf,fkk,b1,b2
a2,acb,dfg,ghj,b3,c4
a3,djf,wdjg,fkg,dff,ggk,d4,d5
Expected output:
a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies
7. Shell Programming and Scripting
Hello,
I'm trying to get the TOP and BASE numbers printed out
File looks like this:
2300 CAR # 2300 is the TOP
2310 CAR
2335 CAR
2455 CAR # 2455 is the BASE
1000 MOTOR # 2455 will become this TOP
2000 MOTOR
3000 MOTOR
4000 MOTOR # 4000 is the BASE
2345 BIKE # 4000... (8 Replies)
Discussion started by: charlieglen
8 Replies
8. Shell Programming and Scripting
Hi,
I have this code:
cat file.txt | awk -F, 'NR==1{print $6","$8","$10","$20","$21","$19}' > file.tmp
VAR1=`cat file.tmp | cut -d "," -f1`
VAR2=`cat file.tmp | cut -d "," -f2`
VAR3=`cat file.tmp | cut -d "," -f3`;
VAR4=`cat file.tmp | cut -d "," -f4`;
VAR5=`cat... (1 Reply)
Discussion started by: Tr0cken
1 Replies
9. Shell Programming and Scripting
Hi everybody (first time posting here)
I have a file1 that looks like >
1,101,0.1,0.1
1,26,0.1,0.1
1,3,0.1,0.1
1,97,0.5,0.5
1,98,8.1,0.218919
1,99,6.2,0.248
2,101,0.1,0.1
2,24,3.1,0.147619
2,25,23.5,0.559524
2,26,34,0.723404with 762 lines..
I have another 'similar' file2 >
... (10 Replies)
Discussion started by: murpholinox
10 Replies
10. 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