By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,668 Members | 1,404 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,668 IT Pros & Developers. It's quick & easy.

parsed data in different position

P: 27
Hi all,

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

These file contain data like:-

00000237162724000002371627245557781803000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 001099001099320%00109920%IPY 2007013120070227Y99991231N YYX SRT0001010120%0000503318882HANDH800 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
Feb 25 '08 #1
Share this Question
Share on Google+
2 Replies

radoulov
P: 34
Hi all,

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

These file contain data like:-

00000237162724000002371627245557781803000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 001099001099320%00109920%IPY 2007013120070227Y99991231N YYX SRT0001010120%0000503318882HANDH800 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?

Expand|Select|Wrap|Line Numbers
  1. ubuntux% cut -c 1-14 file
  2. 00000237162724
  3.  
  4. % cut -c 29-39 file
  5. 55577818030
  6.  
With cut (GNU coreutils):
Expand|Select|Wrap|Line Numbers
  1. % cut -c 1-14,29-39 --output-delimiter=" "  file
  2. 00000237162724 55577818030
Feb 25 '08 #2

P: 27
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
Feb 26 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.