kartapacio
Technical User
Hi,
I am trying to convert a file to a particular format.
What i want is to get field $5 (for example) 32char long so, if its less than 32, add chars up to 32 and if its more than 32, cut them down...
I think it will be something like :
if (length($5) < 32) {
while (length($5) <33 {
add space to $5
}
}
But i can´t find the actual way of doing it...
Someone can give me a hand with this?
I am trying to convert a file to a particular format.
What i want is to get field $5 (for example) 32char long so, if its less than 32, add chars up to 32 and if its more than 32, cut them down...
I think it will be something like :
if (length($5) < 32) {
while (length($5) <33 {
add space to $5
}
}
But i can´t find the actual way of doing it...
Someone can give me a hand with this?