[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Multi-character field separators in sort
From: |
Michael Muratet |
Subject: |
Multi-character field separators in sort |
Date: |
Wed, 19 Aug 2009 11:11:25 -0500 |
Greetings
I'm sure this question has come up, but I cannot find the answer in
the archives. I have a make file generated by a third-party python
script with the following line that I am trying to run in bash on
CentOS 5.2:
set -o pipefail; cat s_1_1_export.txt | \
awk -F$'\t' '$13 != "" && $NF == "Y" {OFS="\t"; --NF; $13 =
sprintf("%011d", $13+10000); print $0}' | \
sort -T . --field-separator=" " --buffer-size=500M -k11,13 | \
awk -F$'\t' '{OFS="\t"; $13 = $13-10000; print $0}' >
s_1_1_sorted.txt.tmp && mv s_1_1_sorted.txt.tmp s_1_1_sorted.txt
I am having two problems with the sort command. The first is that it
reports sort: cannot create temporary file: ./sortdKFMLK: Permission
denied. The directory permissions are wide open. I solved that by
increasing the buffer to 1000M. The second problem persists. The 3-
space field separator is generating an error, sort: multi-character
tab ' ". I've found a lot of discussion about how various shells
treat escaped characters, but I'm looking for a definitive statement
that sort can handle separators with more than one character (or not).
I have v5.97 of the coreutils and b3.2.25(1) of bash.
Thanks
Mike
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Multi-character field separators in sort,
Michael Muratet <=