truncate help

This is a discussion on truncate help within the Linux Programming forums, part of the Platform Specific Boards category; hi all i have a text like this AAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90 ...

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    136

    truncate help

    hi all
    i have a text like this
    AAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90 AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90 BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90 AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
    i wanna output like this
    AAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90
    AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90
    BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90
    AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
    line by line

    is there any script to do like this

    please help me

    thank you in advance

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,418
    So does the first one contain any newlines at all, or did you just line wrap it for posting?

    And when you say "script", are you considering sed/awk/perl as being suitable candidates?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    136
    hi all
    i have a text like this
    1). i would like to remove [5]....[234XXX] in this
    2). and line by line
    [5]AAAAA [6]GGGGGG [7]25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90 [8]AAAAA [9]GGGGGG [10]29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90 [11]BBBBBB [12]GGGGGG [13]25OC200 [14]CE [15]5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90 [16]AAAAA [17]GGGGGG [18]27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
    i wanna output like this

    AAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90
    AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90
    BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90
    AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
    please help me

    present am using two command to do this all
    Code:
    sed "s/\[[0-9]\{1,\}\]//g"
    sed "s/\.\([0-9]*\)\ \([A-Z]\)/\.\1\n\2/g"
    i have to combine these two to one....

    thank you in advance

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    136
    hi all
    i have a text file like this
    AAAAA GGGGGG 25OC200 - - 5389.80 5203.10
    5673.15 5255.00 89085 234115.83 5143.9
    AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265
    13869.14 5143.90
    BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00
    168.60 34.05 810 2281.01 5143.90
    AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64
    5143.90
    i wanna output like this
    AAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90
    AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90
    BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90
    AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
    please help me

    thank you in advance

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how can i truncate this
    By munna_dude in forum C Programming
    Replies: 11
    Last Post: 04-10-2007, 11:35 AM
  2. is there a way to truncate an array
    By panfilero in forum C Programming
    Replies: 1
    Last Post: 11-03-2005, 03:07 AM
  3. MYSQL++ truncate
    By LTLhawk in forum C++ Programming
    Replies: 2
    Last Post: 08-30-2003, 06:56 PM
  4. truncate
    By hoodiemama in forum C++ Programming
    Replies: 4
    Last Post: 11-02-2002, 05:37 PM
  5. How to truncate URL string to filename?
    By theLastSlacker in forum C++ Programming
    Replies: 6
    Last Post: 09-11-2002, 12:00 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21