AuthorTopic: O/T - Automated text file editing - CALLING TECHIES!  (Read 468 times)

0 Members and 1 Guest are viewing this topic.

Offline Horness

  • Posts: 469
  • Attack: 100
    Defense: 100
    Attack Member
  • Karma: +0/-0
  • Referrals: 0
O/T - Automated text file editing - CALLING TECHIES!
« on: December 20, 2005, 14:43:07 »
I am looking for either some nifty code, or a small app to automate the editing of a text file. (Anyone sh*t hot with batch files?)

The text file format does not need to be changed, however the first line, and last 2 lines need to be removed for it to work correctly with another application. The text file can vary in length, and filename as well.

I know it's only a 5 second job to strip them out and re-save, however the "operator" who will be doing this is about as technical as a bowl of salad, and still stares in awe as the arrow moves on screen when she moves the mouse.

Any help appreciated.

Horness.

Offline xmob

  • Regional Rep
  • *
  • Posts: 681
  • Attack: 100
    Defense: 100
    Attack Member
  • Karma: +0/-0
  • Referrals: 0
O/T - Automated text file editing - CALLING TECHIES!
« Reply #1 on: December 20, 2005, 20:17:16 »
In *nix, it's an easy one liner:

Code: [Select]
cat inputfile.txt | sed '1 d' | sed '$ d' | sed '$ d' > outputfile.txt
Clyde 2.0 - Disco 200tdi
Bonnie - Freelander TD4 ES Premium

 






SimplePortal 2.3.5 © 2008-2012, SimplePortal