GNU bug report logs - #14416
cut -c --output-delimiter stops inserting delimiters : bug?

Previous Next

Package: coreutils;

Reported by: Konstantin Weber <weber <at> ac-autoconsult.de>

Date: Fri, 17 May 2013 15:48:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14416 in the body.
You can then email your comments to 14416 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#14416; Package coreutils. (Fri, 17 May 2013 15:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Konstantin Weber <weber <at> ac-autoconsult.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 17 May 2013 15:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Konstantin Weber <weber <at> ac-autoconsult.de>
To: bug-coreutils <at> gnu.org
Subject: cut -c --output-delimiter stops inserting delimiters : bug?
Date: Fri, 17 May 2013 15:33:12 +0200
Hello,

today I received a large text file with fixed-length data fields to import them into our databases.
I used the mighty cut but had to discover that it stops inserting output-delimiters when there are a lot of ranges.

My prompt was:
cut -b30-34,37-41,53-82,83-112,113-142,143-148,153-182,233-262,263-292,293-322,323-327,233-352 --output-delimiter=";" GER0506.dat > GER0506_true.csv

The output only has  the first 7 semicolons of the expected eleven.
I fixed it for my case by running cut a second time (
cut -b1-172,174-202,204-232,234-238,244-263 --output-delimiter=";" GER0506_true.csv > GER0506.csv
) but decided to report this behaviour because it seems undesired. Either I get output-delmiters (all of them) or not.

Is this a bug?

> cut --version
cut (GNU coreutils) 8.14
Copyright © 2011 Free Software Foundation, Inc.





Information forwarded to bug-coreutils <at> gnu.org:
bug#14416; Package coreutils. (Fri, 17 May 2013 16:51:01 GMT) Full text and rfc822 format available.

Message #8 received at 14416 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Konstantin Weber <weber <at> ac-autoconsult.de>
Cc: 14416 <at> debbugs.gnu.org
Subject: Re: bug#14416: cut -c --output-delimiter stops inserting delimiters
	: bug?
Date: Fri, 17 May 2013 17:50:29 +0100
tag 14416 notabug
close 14416
stop

On 05/17/2013 02:33 PM, Konstantin Weber wrote:
> Hello,
> 
> today I received a large text file with fixed-length data fields to import them into our databases.
> I used the mighty cut but had to discover that it stops inserting output-delimiters when there are a lot of ranges.
> 
> My prompt was:
> cut -b30-34,37-41,53-82,83-112,113-142,143-148,153-182,233-262,263-292,293-322,323-327,233-352 --output-delimiter=";" GER0506.dat > GER0506_true.csv

You typoed it.
s/233-352/328-352/

Or if you expected that to duplicate part of the line to a new field,
cut doesn't support that, and I suggest you preprocess first if you want that.

cheers,
Pádraig.




Added tag(s) notabug. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 19 Oct 2018 00:33:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 14416 <at> debbugs.gnu.org and Konstantin Weber <weber <at> ac-autoconsult.de> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 19 Oct 2018 00:33:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 16 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.