Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005

    Question Unanswered: parsing data from Flat file

    Hi all,

    I've a flat file and has 10 lines or records that are not delimited by any space or delimiter. For each line, ie: SSN is position 10 to 19 and trailer death status is on line 10, position 20 to 21.

    How do I view data in flat file where I specify a line number, from position and to position? Pls specify what function, command, syntax should I use, please provide an example.


  2. #2
    Join Date
    May 2005
    South Africa
    Provided Answers: 1
    You can use a while loop to loop tru the file
    And use cut -c
    see tread for example
    Or to view e.g. line 3
    sed -n '3p' flatfile | cut -c10-19,20-21

  3. #3
    Join Date
    Mar 2005

    Thanks a lot

    It was really helpful as it will help me automate the flat file validation instead of the tedious manual validation using TextPad.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts