need tool to eliminate extra space at end of line or excel colum

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkx
    Confirmed User
    • Nov 2003
    • 4001

    #1

    need tool to eliminate extra space at end of line or excel colum

    I have a bunch of extra spaces at the end of lines that I need gone, is there a tool to do this?

    Example

    dsalfjsdf
    dsfjsfsdlfj
    sdaufjlsdjaf
    jfsdlfjsdf
  • latinasojourn
    Confirmed User
    • Oct 2003
    • 3191

    #2
    Originally posted by mkx
    I have a bunch of extra spaces at the end of lines that I need gone, is there a tool to do this?

    Example

    dsalfjsdf
    dsfjsfsdlfj
    sdaufjlsdjaf
    jfsdlfjsdf

    if lines are same length it is easy:

    use column mode with this utility:
    ultra-edit32

    Comment

    • mkx
      Confirmed User
      • Nov 2003
      • 4001

      #3
      they are all different lengths

      Comment

      • micker
        Confirmed User
        • Nov 2005
        • 748

        #4
        if its just the column... paste it into a text file, shen on a mac or linux box, or if you are shelled into your host, you can run this command on the text file you pasted the column into.

        sed 's/[ ^t]*$//' YOUR_TEXT_FILE

        then paste the output back into the native app...

        Comment

        • WarChild
          Let slip the dogs of war.
          • Jan 2003
          • 17263

          #5
          Built in function in Excel "trim()". Simple, simon.
          .

          Comment

          • mkx
            Confirmed User
            • Nov 2003
            • 4001

            #6
            Originally posted by WarChild
            Built in function in Excel "trim()". Simple, simon.

            How do i enter that? I suck at excel

            Comment

            • WarChild
              Let slip the dogs of war.
              • Jan 2003
              • 17263

              #7
              Originally posted by mkx
              How do i enter that? I suck at excel
              Alright, let's say the data you need to trim is located in Column A.
              Create a second column beside it, or use an empty one that exists. For our purposes we'll call it Column B.

              1) In the first cell of Column B (Cell B1) enter the following "=trim(a1)"
              2) Highlight this cell and all the cells below it that correspond with data that needs to be trimmed. Say you have 71 rows of data, you will highlight Cells B1-B71 and press CTRL-D (This is the copy down command). This will copy your formula all the way down, but fill in the cells correctly. For example, cell B2 will have the forumla trim(a2) and etc all the way down.

              You're not done yet, because the new data is formula based, so if you delete column A, the data will vanish in column B as there's nothing to base the formulas on anymore. Not to worry.

              3) Select all of column B, and press CTRL-C (Copy).
              4) With all of columb B still highlighted, right click on it and select "Paste Special". Select the third radial button down "Values" and press OK.

              Now all of Column B is populated with the trimmed data and is no longer based on a formula.

              5) Delete the original Column, Column A.

              You're done.
              .

              Comment

              • mkx
                Confirmed User
                • Nov 2003
                • 4001

                #8
                whooohooo, thx

                Comment

                • BlueDesignStudios
                  Confirmed User
                  • Feb 2003
                  • 9492

                  #9
                  trim is da shit!!

                  Blue Design Studios - Adult Design Specialists!
                  Email me for a free quote: [email protected]

                  Comment

                  Working...