Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. VitasL

    Removing last field header leaves comma (,) instead

    p5wizard and PHV - your solutions both worked! Thank you very much for your persistence on this issue. Thanks again for everyone for contributing. I learned a lot, and that's probably the most valuable thing of all! Time to donate some $$ to this site! It was worth it!
  2. VitasL

    Removing last field header leaves comma (,) instead

    Thank you for the suggestion! However, I see no change in the output file. TEST field and header still remain. Did I miss something? $ more test3.csv COMPANY,TRANS-TYPE,INVOICE,CUSTOMER,STATUS,GL-STATUS,BATCH-NBR,PROCESS-LEVEL,TRANS-DATE,GL-DATE,DESC,ORIG-AMT,TEST...
  3. VitasL

    Removing last field header leaves comma (,) instead

    I wanted to thank everyone for their input. Your responses were amazing for this time of week and day. Thank you very, very much. I think that I will have to resort to some variation of the printf command where I specifically detail each field and which separator to use, excluding the last one...
  4. VitasL

    Removing last field header leaves comma (,) instead

    Feherke, Not sure what you are asking. My version of awk? I am on AIX 5.3, IBM 9110-510. Field is removed with no problem, just the pesky comma remains. Unfortunately, I need csv file for further processing, just not one on the last field ... Any other ideas?
  5. VitasL

    Removing last field header leaves comma (,) instead

    Sorry for the typing errors. Now, it seems, output looks same as input. No changes made. I'm puzzled ... awk 'BEGIN{FS=",";OFS=","} ; {NF--; print}' test3.csv > test4.csv COMPANY,TRANS-TYPE,INVOICE,CUSTOMER,STATUS,GL-STATUS,BATCH-NBR,PROCESS-LEVEL,TRANS-DATE,GL-DATE,DESC,ORIG-AMT,TEST...
  6. VitasL

    Removing last field header leaves comma (,) instead

    Annihilannic, Good eye! It ran, but now I've introduced another character after the comma I am trying to remove (along with the last header and field): $ awk 'BEGIN{FS=",";OFS=","} ; {$NF--; print}' test3.csv > test4.csv...
  7. VitasL

    Removing last field header leaves comma (,) instead

    Annihilannic, Not sure I follow you. Which extra "=" are you referring to? p5wizard's solution or my response to it? Thanks for helping!
  8. VitasL

    Removing last field header leaves comma (,) instead

    It complains ... syntax error The source line is 1. The error context is BEGIN{FS=",";OFS=","} ; >>> {NF=--; <<< awk: The statement cannot be correctly parsed. The source line is 1. Thanks for the fast response!!!!
  9. VitasL

    Removing last field header leaves comma (,) instead

    I'm totally new at this, so maybe, hopefully, this is an easy one. I have a file which I want to remvoe the last field and header, keeping the OFS="," When I execute the command, the last field and header are removed, but what is left is a comma (,) at the end. I am expecting nothing. my file...

Part and Inventory Search

Back
Top