LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Text conversion help (https://www.linuxquestions.org/questions/linux-newbie-8/text-conversion-help-4175599677/)

jdoginky 03-02-2017 03:04 PM

The requirements are:
If char 3-5 is in the convert file
If char 3-5 and 138-140 match
convert both
else
convert char 3-5
replace char 138-140 with spaces
fi
fi

pan64 03-03-2017 12:31 AM

in awk you can use the function substr to get char3-5 or similar, so looks pretty easy to check.
conversion and replacement also easy, you need to split your line into 5 pieces: before 3, 3-5, 6-137, 138-140, 141- and construct the result by concatenating required parts.


All times are GMT -5. The time now is 07:05 AM.