parsed data in different position

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vaskarbasak
    New Member
    • Feb 2008
    • 27

    parsed data in different position

    Hi all,

    I have a text file name "test.txt".

    These file contain data like:-

    000002371627240 000023716272455 577818030000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 001099001099320 %00109920%IPY 200701312007022 7Y99991231N YYX SRT0001010120%0 000503318882HAN DH800 R

    i have to cut data in different position like 1-14,29-39 etc.

    and then save the result in another file.

    i have tried it but failed!

    pls help me.I am new in linux platform.

    Thanks!
    Vaskar
  • radoulov
    New Member
    • Jun 2007
    • 34

    #2
    Originally posted by vaskarbasak
    Hi all,

    I have a text file name "test.txt".

    These file contain data like:-

    000002371627240 000023716272455 577818030000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 001099001099320 %00109920%IPY 200701312007022 7Y99991231N YYX SRT0001010120%0 000503318882HAN DH800 R

    i have to cut data in different position like 1-14,29-39 etc.

    and then save the result in another file.

    i have tried it but failed!

    pls help me.I am new in linux platform.

    Thanks!
    Vaskar
    Did you try cut?

    Code:
    ubuntux% cut -c 1-14 file
    00000237162724
    
    % cut -c 29-39 file
    55577818030
    With cut (GNU coreutils):
    Code:
    % cut -c 1-14,29-39 --output-delimiter=" "  file
    00000237162724 55577818030

    Comment

    • vaskarbasak
      New Member
      • Feb 2008
      • 27

      #3
      cut -c 1-14,29-39 --output-delimiter=" " file

      i have tried the command.But there is no space or tab showing in the out put display.pls help me.

      Thanks!
      vaskar

      Comment

      Working...