Code:
#! /bin/bash
#################################################
# PolishCut #
# #
# delimiter: used to seperate different users #
# outFile : Contains the path were the output #
# file will be placed #
# #
#################################################
delimiter="--------------------------------------------------------"
printf "Specify the path of the output file \n";
read outFile
touch "$outFile"
while read
do
if egrep -q 'nazwisko|transakcji|Nale|data|konta' <<< "$REPLY" # Using here strings to extract wanted fields
then
printf " $REPLY\n"
elif [ "$REPLY" == "$delimiter" ] # If read line equals delimiter in this case ------
then
printf "\n $delimiter \n"
fi
done < "$1" >> "$outFile" # Input file(parameter) into while loop and redirects output to desired path
This is the way to call the script:
Quote:
bash polishCut File to handle
(Obviously, I named my script polishCut, in your honor

)
It will now ask the path of the new file that is going to be created.
Please take in mind that the directory in which the file is going to be created needs to have the adecuate writing permissions.
Also feel free to ask/appoint any possible doubt/error that might come up during the use of this script. Im glad to help