Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    awk '$1=$1' RS= file? Commented May 17, 2020 at 13:01
  • You could just make sure the second character is not a slash ex. [A-Z][^/] or [[:upper:]][^/]. But really I second @Cyrus suggestion ... Commented May 17, 2020 at 13:10
  • It doesn't work. It creates a line like this: Door $0.00 N/A 7 3 Nails $0.10 N/A 7 5 Sofa $0.07 100 7 3 Stool $1.00 0 7 5 Natural wood $0.00 99 7 20 Commented May 17, 2020 at 13:10
  • 1
    As I cannot fully explain GNU awk's behaviour in conjunction with empty RS, here only as a comment: awk '$1=$1' RS= FS='\n' OFS='\t' file Commented May 17, 2020 at 13:46
  • 1
    @EdMorton: Thanks for the explanation. Commented May 17, 2020 at 20:20