multiply digits inside numbers based on poition of digit
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I know this may seem hard but you guys are really bold. I appreciate your help!
I have list of numbers like this
0987656787689
2345453326780
3453212332345
1324532449876
1234532444568
3245321343456
1324354532376
1234532153457
I want results of multiplication of the digits in positions sixth and seventh which are:
56
53
12
32
32
21
54
32
and the multiplication:
30
15
2
6
6
2
20
6
bash
add a comment |Â
up vote
-1
down vote
favorite
I know this may seem hard but you guys are really bold. I appreciate your help!
I have list of numbers like this
0987656787689
2345453326780
3453212332345
1324532449876
1234532444568
3245321343456
1324354532376
1234532153457
I want results of multiplication of the digits in positions sixth and seventh which are:
56
53
12
32
32
21
54
32
and the multiplication:
30
15
2
6
6
2
20
6
bash
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I know this may seem hard but you guys are really bold. I appreciate your help!
I have list of numbers like this
0987656787689
2345453326780
3453212332345
1324532449876
1234532444568
3245321343456
1324354532376
1234532153457
I want results of multiplication of the digits in positions sixth and seventh which are:
56
53
12
32
32
21
54
32
and the multiplication:
30
15
2
6
6
2
20
6
bash
I know this may seem hard but you guys are really bold. I appreciate your help!
I have list of numbers like this
0987656787689
2345453326780
3453212332345
1324532449876
1234532444568
3245321343456
1324354532376
1234532153457
I want results of multiplication of the digits in positions sixth and seventh which are:
56
53
12
32
32
21
54
32
and the multiplication:
30
15
2
6
6
2
20
6
bash
bash
asked 4 mins ago
Koran
275
275
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Perl to the rescue!
perl -F// -lane 'print $F[5] * $F[6]' < file
-n
reads the input line by line-a
splits each line into the @F array-F
tells how to split//
means to split everywhere, i.e. into single characters-l
removes newlines from input and adds them to output
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Perl to the rescue!
perl -F// -lane 'print $F[5] * $F[6]' < file
-n
reads the input line by line-a
splits each line into the @F array-F
tells how to split//
means to split everywhere, i.e. into single characters-l
removes newlines from input and adds them to output
add a comment |Â
up vote
0
down vote
Perl to the rescue!
perl -F// -lane 'print $F[5] * $F[6]' < file
-n
reads the input line by line-a
splits each line into the @F array-F
tells how to split//
means to split everywhere, i.e. into single characters-l
removes newlines from input and adds them to output
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Perl to the rescue!
perl -F// -lane 'print $F[5] * $F[6]' < file
-n
reads the input line by line-a
splits each line into the @F array-F
tells how to split//
means to split everywhere, i.e. into single characters-l
removes newlines from input and adds them to output
Perl to the rescue!
perl -F// -lane 'print $F[5] * $F[6]' < file
-n
reads the input line by line-a
splits each line into the @F array-F
tells how to split//
means to split everywhere, i.e. into single characters-l
removes newlines from input and adds them to output
answered 1 min ago
choroba
25.1k34269
25.1k34269
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475321%2fmultiply-digits-inside-numbers-based-on-poition-of-digit%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password