remove space and replace in notepad

i want to remove all the spaces in the attached notepad.txt file and replace with a " | ".

when i do a find and replace and press the Space bar, then put the | in the replace it does not do anything. this is in notepad++

generally i am doing this when i take data from excel and need to put it into a .txt file in notepad. i always get spaces where the cells separate the data in excel. maybe there is a way to format the excel spreadsheet when i save it so the spaces are not there in the .txt file? expert-exchange-example.txt
Who is Participating?
Saqib Husain, SyedEngineerCommented:
These are tabs and not spaces.

Select one of those tabs and press ctrl-c to copy it
paste it in the search-replace dialog box instead of the space.
The rest you know

Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:

some of the spacing between your columns are tab signs, not spaces. This probably means that in Excel as the source of the file, you have empty columns.

remove the Empty columns and the save your Excel file again, then then you can replace spaces with | just fine.

cheers, teylyn
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Or save your Excel file as a CSV file with commas to separate the fields, then replace commas with |

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Hmm not sure how you would do this in notepad++ as I don't use it.

But if you can locate the .txt file open it with Wordpad click replace, this will open the replace box.

Place your cursor in the Find what field and press the space bar, then place your cursor in the Replace with field and type |. Then click Replace or Replace All as you require.
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
OK, here's what you can do in Notepad++:

Select a tab sign and copy it
- Ctrl H to replace all tabs with space
- Ctrl H to replace all spaces with |

this will yield some duplicate || since your data had spaces and tabs next to each other,

Finally Ctrl H to replace all || with |

cheers, teylyn
g11mediaAuthor Commented:
i have another one for you regarding find and replace. how do i find and replace carriage return (CR) and/or line feed (LF) in the attached notepad++ (or notepad).

better yet, how do i now have it when i save from excel. i saved this file as a .csv and got rid of "," and replaced with nothing.  expertexchange-linefeed-CR.txt
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.