LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 09-25-2019, 06:11 AM   #31
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783

@MadeInGermany kindly gave you a start in post #10

the sample html obtained from iban-registry-pdf contains at least 72 valid iban ( possibly 78, but 72 in tables )
 
1 members found this post helpful.
Old 09-25-2019, 08:00 AM   #32
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,661

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by philip370 View Post
Fieat dont accuse me of lieing please enough ok..
...and....
Quote:
Originally Posted by philip370
Fine fine fine u have the last word
Sorry, you were caught; and you again need to read the LQ Rules about text speak and not using it, along with not bumping your own thread without adding more information (things like "please be nice", add nothing). You also need to read the "Question Guidelines" about showing your own efforts and providing clear information.

You **STILL** have not provided us an example of what you're looking for, shown us the input data you're trying to search, or tell us what YOU have done. If 'you' figured out how to do a pretty complex grep for emails, this should be trivial, especially since post #10 gave you pretty much everything you need. A VERY slight modification of what's there gives you the output you want, based on the picture posted.
 
Old 09-25-2019, 08:05 AM   #33
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
yeap, no sample data, no clue on what the structure of what to search for is.

And still I have a grep PATTERN for IBAN, which does both the electronic and printed formats ( I can add "-" to the printed format )

all thanks to wikipedia

I've not done anything to validate the IBAN yet
 
Old 09-25-2019, 10:24 AM   #34
philip370
LQ Newbie
 
Registered: Sep 2019
Posts: 19

Original Poster
Rep: Reputation: Disabled
thanks

I wasnt caught out. ok all of u guys thaks for you support even Fireat.. cheers.
 
Old 09-25-2019, 10:38 AM   #35
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,328
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
What solution did you arrive at and how did you do the checksum?
 
1 members found this post helpful.
Old 09-25-2019, 10:54 AM   #36
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,661

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by philip370 View Post
I wasnt caught out.
Sorry, wrong. When you claim to have done a fairly complex search by yourself, then claim to NOT be able to do a simple one...you are caught.
Quote:
ok all of u guys thaks for you support even Fireat.. cheers.
AGAIN: DO NOT USE TEXT SPEAK. Again; post #10 handed you your homework solution.
 
Old 09-25-2019, 11:17 AM   #37
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
here is how I did it

the sed was just to deal with the html that I got from converting that pdf
( I wanted the html for noise, txt is easier )

it is a little dumb,
only spits out valid IBAN

Code:
#!/bin/bash
GetIBAN (){
    < "$1" grep -w -o \
      '[[:alpha:]]\{2\}[0-9]\{2\}\( \?[0-9]\{3\} \?\)\?\([[:alpha:]]\{4\}\)\?\([- ]\?[[:alnum:]]\{4\} \?\)\{2,6\}\([- ]\?[[:alnum:]]\{1,3\}[- ]\?\)\?'
}
declare -A AtoN=(
    [A]="10" [B]="11" [C]="12" [D]="13" [E]="14" [F]="15"
    [G]="16" [H]="17" [I]="18" [J]="19" [K]="20" [L]="21"
    [M]="22" [N]="23" [O]="24" [P]="25" [Q]="26" [R]="27"
    [S]="28" [T]="29" [U]="30" [V]="31" [W]="32" [X]="33"
    [Y]="34" [Z]="35"
    )
while read IBAN
do
    IBAN=${IBAN//[- ]}
    IBANn=${IBAN^^}
    IBANn="${IBANn:4}${IBANn:0:4}"
    for ((i=0;i<${#IBAN};i++))
    do  
        IBANa=${IBAN:$i:1}
        if [[ ${IBANa^} =~ [A-Z] ]]
        then
            IBANn=${IBANn//${IBANa}/${AtoN[${IBANa^}]}}
        fi
    done
    [[ $(bc <<< "${IBANn} % 97") == 1 ]] && echo ${IBAN}
done < <(GetIBAN "$1")
ok, so it seems that you can't use * "& # 1 6 0 ;" ( no spaces )
get replaced with \*

Last edited by Firerat; 09-25-2019 at 11:27 AM. Reason: forget sed bit
 
Old 09-25-2019, 04:24 PM   #38
philip370
LQ Newbie
 
Registered: Sep 2019
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thanks
 
Old 09-25-2019, 05:19 PM   #39
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
What is it they say about Greeks ?


Good Luck
 
Old 09-25-2019, 05:57 PM   #40
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
@all,

Please remember to keep conversation civil and to recognize that new members to Linux Questions may benefit with polite welcomes, along with references to the various LQ FAQ links which provide information as to how to improve thread questions. I do feel that this practice was followed with the first reply to the question.

I also feel that rapid responses in this question have led to some problems.

There have been a great deal of impolite posting towards each other, and I feel this should stop.

Even though the title says LQ Rules
I consider it to be "Rules and Guidelines" because there are points in there which are common sense:
  • Do not post if you do not have anything constructive to say in the post.
  • When posting in an existing thread, ensure that what you're posting is on-topic and relevant to the thread - For technical forums, this means to keep the subject related to the thread question.
  • Challenge others' points of view and opinions, but do so respectfully and thoughtfully ... without insult and personal attack. Differing opinions is one of the things that make this site great.
  • Do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and searches) and we'll do our best to help.
Regarding the non-needed posts in this thread. Our existing LQ members should know that we're here to help, and to do so politely. While I fully understand that there are times when a response does not provide enough information, if there are serious issues, then please use the Report button. If there seem to be communications issues, then please try to work those through in a polite manner. If this is not possible, then please refrain from adding further to the thread.
 
1 members found this post helpful.
Old 09-25-2019, 06:19 PM   #41
philip370
LQ Newbie
 
Registered: Sep 2019
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thanks, as a newby I appreciate the help I have received here.
 
Old 09-25-2019, 06:39 PM   #42
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
The problem is you have not learnt anything.

I have a feeling you will be dropping out of that course.
 
Old 09-25-2019, 07:10 PM   #43
philip370
LQ Newbie
 
Registered: Sep 2019
Posts: 19

Original Poster
Rep: Reputation: Disabled
Fireat I have enough of you smart comments..( i have asked u more than one to be nice guess u just cant , can u) Moderator please intervine here thanks..
 
Old 09-25-2019, 07:18 PM   #44
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Firerat, I specifically said to keep this thread on topic, civil, and to avoid personal attacks.
 
Old 09-25-2019, 07:19 PM   #45
philip370
LQ Newbie
 
Registered: Sep 2019
Posts: 19

Original Poster
Rep: Reputation: Disabled
thanks rtmistler much appreciated.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an alias in ksh that uses grep and includes 'grep -v grep' doug248 Linux - Newbie 2 08-05-2012 02:07 PM
[SOLVED] Grep -p for Linux, Trying to grep a paragraph. ohijames Linux - Newbie 5 07-22-2010 02:09 PM
What does rpm -qa |grep th* (as compared to rpm -qa |grep th) display? davidas Linux - Newbie 2 03-18-2004 01:35 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 03:11 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration