<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Sorting on fixed width file in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Sorting-on-fixed-width-file/m-p/398377#M250174</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;how to sort this below output in Ascending order&amp;nbsp; by maintaining same space in both header values. I've tried using query record but couldn't able to add spaces using SPACE function. but space which i've given is considering as&amp;nbsp;SPACE(numeric) value instead of INT.&lt;/P&gt;&lt;P&gt;input:&lt;/P&gt;&lt;P&gt;NO CUSTOM.;NO INCSUPB;NO ALLBPBM ;IMPORTE BRUTO;DESCUENTO;IMPORTE NETO&lt;BR /&gt;0000000023;123548&amp;nbsp; &amp;nbsp; ;999888&amp;nbsp; &amp;nbsp; &amp;nbsp;;875,92&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;176,88&amp;nbsp; &amp;nbsp;;699,04&lt;BR /&gt;0000000012;123547&amp;nbsp; &amp;nbsp; ;777666&amp;nbsp; &amp;nbsp; &amp;nbsp;;2347,04&amp;nbsp; &amp;nbsp; &amp;nbsp; ;591,84&amp;nbsp; &amp;nbsp;;1755,2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected Output:&lt;/P&gt;&lt;P&gt;NO CUSTOM.;NO INCSUPB;NO ALLBPBM ;IMPORTE BRUTO;DESCUENTO;IMPORTE NETO&lt;BR /&gt;0000000012;123547&amp;nbsp; &amp;nbsp; ;777666&amp;nbsp; &amp;nbsp; &amp;nbsp;;2347,04&amp;nbsp; &amp;nbsp; &amp;nbsp; ;591,84&amp;nbsp; &amp;nbsp;;1755,2&lt;BR /&gt;0000000023;123548&amp;nbsp; &amp;nbsp; ;999888&amp;nbsp; &amp;nbsp; &amp;nbsp;;875,92&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;176,88&amp;nbsp; &amp;nbsp;;699,04&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 17:34:59 GMT</pubDate>
    <dc:creator>PradNiFi1236</dc:creator>
    <dc:date>2024-12-03T17:34:59Z</dc:date>
    <item>
      <title>Sorting on fixed width file</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Sorting-on-fixed-width-file/m-p/398377#M250174</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;how to sort this below output in Ascending order&amp;nbsp; by maintaining same space in both header values. I've tried using query record but couldn't able to add spaces using SPACE function. but space which i've given is considering as&amp;nbsp;SPACE(numeric) value instead of INT.&lt;/P&gt;&lt;P&gt;input:&lt;/P&gt;&lt;P&gt;NO CUSTOM.;NO INCSUPB;NO ALLBPBM ;IMPORTE BRUTO;DESCUENTO;IMPORTE NETO&lt;BR /&gt;0000000023;123548&amp;nbsp; &amp;nbsp; ;999888&amp;nbsp; &amp;nbsp; &amp;nbsp;;875,92&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;176,88&amp;nbsp; &amp;nbsp;;699,04&lt;BR /&gt;0000000012;123547&amp;nbsp; &amp;nbsp; ;777666&amp;nbsp; &amp;nbsp; &amp;nbsp;;2347,04&amp;nbsp; &amp;nbsp; &amp;nbsp; ;591,84&amp;nbsp; &amp;nbsp;;1755,2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected Output:&lt;/P&gt;&lt;P&gt;NO CUSTOM.;NO INCSUPB;NO ALLBPBM ;IMPORTE BRUTO;DESCUENTO;IMPORTE NETO&lt;BR /&gt;0000000012;123547&amp;nbsp; &amp;nbsp; ;777666&amp;nbsp; &amp;nbsp; &amp;nbsp;;2347,04&amp;nbsp; &amp;nbsp; &amp;nbsp; ;591,84&amp;nbsp; &amp;nbsp;;1755,2&lt;BR /&gt;0000000023;123548&amp;nbsp; &amp;nbsp; ;999888&amp;nbsp; &amp;nbsp; &amp;nbsp;;875,92&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;176,88&amp;nbsp; &amp;nbsp;;699,04&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 17:34:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Sorting-on-fixed-width-file/m-p/398377#M250174</guid>
      <dc:creator>PradNiFi1236</dc:creator>
      <dc:date>2024-12-03T17:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting on fixed width file</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Sorting-on-fixed-width-file/m-p/400735#M250955</link>
      <description>&lt;LI-CODE lang="python"&gt;#!/bin/bash

# Input data
input_file="input.txt"

# Separate the header and the data
header=$(head -n 1 "$input_file")
data=$(tail -n +2 "$input_file")

# Sort the data numerically by the first column
sorted_data=$(echo "$data" | sort -t';' -k1,1n)

# Combine the header with the sorted data
echo "$header"
echo "$sorted_data"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 20 Jan 2025 10:21:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Sorting-on-fixed-width-file/m-p/400735#M250955</guid>
      <dc:creator>cloude</dc:creator>
      <dc:date>2025-01-20T10:21:24Z</dc:date>
    </item>
  </channel>
</rss>

