Relative Content

Tag Archive for shellawkgetline

Reading from text file and put it into an awk file

I have a file in which there are more than thousand lines and in each line there is a string of 12 characters. I also have an awk script in which there is a function. I want the file to be read every time the function is executed and the first 8 characters of each line of this file will be received as input and the function will be executed for each line of the file. I’d checked similar topics but they didn’t help me. I don’t have the possibility to use Python, Jason and other languages ​​and libraries except shell script. I wrote it in bash script , but now I need to use getline because its not possible to use bash script in awk file.

AWK: reading from text file and put it into an awk file

I have a file in which there are more than thousand lines and in each line there is a string of 12 characters. I also have an awk script in which there is a function. I want the file to be read every time the function is executed and the first 8 characters of each line of this file will be received as input and the function will be executed for each line of the file. I’d checked similar topics but they didn’t help me. I don’t have the possibility to use Python, Jason and other languages ​​and libraries except shell script. I wrote it in bash script , but now I need to use getline because its not possible to use bash script in awk file.