Hi guys,
I am new to shell scripting and I have a small problem...If someone can solve this..that would be great
I am trying to form a XML by reading a flat file using shell scripting
This is my shell script
LINE_FILE1=`cat FLEX_FILE1.TXT | head -1 | tail -1`
echo '<PolicyNumber>'${LINE_FILE1:16:12}'</PolicyNumber>' >>$XML_FILE
16 is the start position of the policy number in the flat file and 12 is the number of characters. Policy number is just 5 characters The result I am getting as below
<PolicyNumber>12345 </PolicyNumber>
There is a space coming after the end of policy number (ie., at 6th position), even though I have seven more spaces in the flat file.
I want to remove this space.
If someone could answer that would be really helpful.
Thanks