GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   need tool to eliminate extra space at end of line or excel colum (https://gfy.com/showthread.php?t=676186)

mkx 11-11-2006 05:10 PM

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 11-11-2006 05:20 PM

Quote:

Originally Posted by mkx (Post 11293961)
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

mkx 11-11-2006 05:27 PM

they are all different lengths

micker 11-11-2006 05:32 PM

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...

WarChild 11-11-2006 05:41 PM

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

mkx 11-11-2006 05:44 PM

Quote:

Originally Posted by WarChild (Post 11294121)
Built in function in Excel "trim()". Simple, simon.


How do i enter that? I suck at excel

WarChild 11-11-2006 06:09 PM

Quote:

Originally Posted by mkx (Post 11294137)
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.

mkx 11-11-2006 06:10 PM

whooohooo, thx :)

BlueDesignStudios 11-11-2006 07:17 PM

trim is da shit!!


All times are GMT -7. The time now is 09:47 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123