Commit 96a0e28d authored by Wahram Andrikyan's avatar Wahram Andrikyan
Browse files

Update SPC_dler

parent f951a403
......@@ -15,3 +15,20 @@ while read link; do
curl --parallel -o $link "URL${link}/fachinformation" - H cookies...
done < links.txt // input file
// get codes
#!/bin/bash
while read link; do
a=$(curl "URL$link" - referrer...
atc=$(echo $a | grep "(ATC" | grep -E -o "[A-Z][0-9]{2}[A-Z]{2}[0-9]{2}" | uniq)
pzn=$(echo $a | grep PZN | grep -w -o "[0-9]\{8\}" | sort -n -u | tr "\n" " ")
echo "$atc $pzn" >> output.txt
done < list.txt
// cosmetics
cat outputcopy.txt | sed "s/39493621 //g"| sort -u | tr " " "\n" | awk '!a[$0]++'| tr "\n" " " > a.txt #delete 39493621, awk removes duplicate lines from text input without pre-sorting
sed 's/\([A-Z]\)\([0-9]\)\([0-9]\)\([A-Z]\)\([A-Z]\)\([0-9]\)\([0-9]\)/\'$'\n&/g' a.txt > b.txt # adds newline before regex. '$'\n is newline for MAC (OSX-sed doesn't know \n ), & pastes regex wherever necessary -> &\'$'\n creates newline after regex
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment