Click here to Skip to main content
15,897,891 members

Comments by Paul Hayman (Top 8 by date)

Paul Hayman 5-Jun-13 8:57am View    
Still no luck i'm afraid....

Creates a file with the following: 2 cells c:\tmp>C:\cygwin\bin\sort -t" " -k6,2 c:\tmp\test.csv 1>c:\tmp\test-sorted.csv"
Paul Hayman 5-Jun-13 8:00am View    
No Still get the error. arghhh I thought it woul dbe easy to sort a csv from command line.... I know it's windows but it's a work pc...
Paul Hayman 4-Jun-13 9:31am View    
OK Thanks so much, I think it's getting close but still not quite right:

C:\cygwin\bin\head -n 1 /cygdrive/c/tmp/CI-tosplit.csv && C:\cygwin\bin\tail -n +1 /cygdrive/c/tmp/CI-tosplit.csv | C:\cygwin\bin\sort -t',' -k5 /cygdrive/c/tmp/CI-tosplit.csv > c:\tmp\CI-DEN-sorted.csv

Gives error:
c:\tmp>C:\cygwin\bin\head -n 1 /cygdrive/c/tmp/CI-tosplit.csv && C:\cygwin\bin
\tail -n +1 /cygdrive/c/tmp/CI-tosplit.csv | C:\cygwin\bin\sort -t',' -k5 /cy
gdrive/c/tmp/CI-tosplit.csv 1>c:\tmp\CI-DEN-sorted.csv
fulfillment_line_item_id,groupon_number,order_date,merchant_sku_item,quantity_re
quested,shipment_method_requested,shipment_address_name,shipment_address_street,
shipment_address_street_2,shipment_address_city,shipment_address_stat,shipment_a
ddress_postal_code,shipment_address_country,gift,gift_message,quantity_shipped,s
hipment_carrier,shipment_method,shipment_tracking_number,ship_date,groupon_sku,c
ustom_field_value,permalink,item_name,vendor_id,salesforce_deal_option_id,groupo
n_cost,billing_address_name,billing_address_street,billing_address_city,billing_
address_stat,billing_address_postal_code,billing_address_country,purchase_order_
number,product_weight,product_weight_unit,product_length,product_width,product_h
eight,product_dimension_unit,customer_phone,incoterms,hts_code,3pl_name,3pl_ware
house_location,kitting_details,sell_price,deal_opportunity_id,shipment_strategy
/usr/bin/tail: write error

It's got the headers but not sure about the write error?? any Ideas?
Paul Hayman 4-Jun-13 9:10am View    
Ah ok I got it, but the header is now the footer lol....
Paul Hayman 4-Jun-13 8:34am View    
Sorry this is using windows:

'tail' is not recognized as an internal or external command,
operable program or batch file.